상속: extends Exception
예제 #1
0
 public function __construct($message = "", $code = 404, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_MODEL_ERR_COULDNOTLOAD');
     }
     parent::__construct($message, $code, $previous);
 }
 public function __construct($base, $path, $lang1, $country1, $lang2, $country2, $lang3, $country3, $code = 0, $prev = null)
 {
     $langs = array();
     if (!empty($lang1)) {
         if (empty($country1)) {
             $langs[] = $lang1;
         } else {
             $langs[] = "{$lang1_}{$country1}";
         }
     }
     if (!empty($lang2)) {
         if (empty($country2)) {
             $langs[] = $lang2;
         } else {
             $langs[] = "{$lang2_}{$country2}";
         }
     }
     if (!empty($lang3)) {
         if (empty($country3)) {
             $langs[] = $lang3;
         } else {
             $langs[] = "{$lang3_}{$country3}";
         }
     }
     parent::__construct("Language not found", "Languages " . implode(', ', $langs) . " and en_US not found for {$base} in {$path}", $code, $prev);
 }
 public function __construct(array $parameters = array())
 {
     parent::__construct($parameters);
     $message = "ERROR: your backend is empty because you haven't configured any Doctrine entity to manage.\n\n";
     $message .= "Solution: open your 'app/config/config.yml' file and configure the backend under the 'easy_admin' key.\n\n";
     $this->setMessage($message);
 }
 public function __construct(array $parameters = array())
 {
     parent::__construct($parameters);
     $message = sprintf("ERROR: the requested '%s' action is not allowed for the '%s' entity.\n\n", $parameters['action'], $parameters['entity']);
     $message .= sprintf("Solution: remove the '%s' action from the 'disabled_actions' option, which can be configured globally for the entire backend or locally for the '%s' entity.\n\n", $parameters['action'], $parameters['entity']);
     $this->setMessage($message);
 }
예제 #5
0
 public function __construct($message = '', $code = 500, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_MODEL_ERR_CANNOTLOCKNOTLOADEDRECORD');
     }
     parent::__construct($message, $code, $previous);
 }
 public function __construct(array $parameters = array())
 {
     parent::__construct($parameters);
     $message = sprintf("ERROR: the '%s' entity is not defined in the configuration of your backend.\n\n", $parameters['entity_name']);
     $message .= sprintf("Solution: open your 'app/config/config.yml' file and add the '%s' entity to the list of entities managed by EasyAdmin.\n\n", $parameters['entity_name']);
     $this->setMessage($message);
 }
예제 #7
0
 public function __construct($message = null, $code = 0, Exception $previous = null)
 {
     if (is_null($message)) {
         $message = "This method has not been implemented yet.";
     }
     parent::_construct($message, $code, $previous);
 }
 /**
  * NotFoundException constructor.
  *
  * @param string $detail
  * @param string $title
  * @param string $instance
  * @param string $type
  */
 public function __construct($detail, $title = '', $instance = '', $type = '')
 {
     $this->detail = $detail ?: $this->title;
     $this->title = $title ?: $this->title;
     $this->instance = $instance;
     $this->type = $type;
     parent::__construct($this->detail);
 }
예제 #9
0
 public function GetTraceError()
 {
     $msg = null;
     if ($this->_lastError instanceof BaseException) {
         $msg = $this->_lastError->getTraceAsString();
     }
     return $msg;
 }
예제 #10
0
 function __construct($str, $info = null, $shift = 0)
 {
     $this->str = $str;
     if (is_object($info)) {
         $this->info['last_query'] = $info->last_query;
         $this->info['mysql_error'] = mysql_error();
     } else {
         $this->info = $info;
     }
     parent::__construct("DBlite error: " . $this->str, null, $shift);
 }
예제 #11
0
 public function __construct($message, $code = 0, $messageToLogFile = NULL)
 {
     parent::__construct($message, $code, $messageToLogFile);
     if (__ENABLE_DEBUG__ == 0) {
         App::redirect('admin/mainside');
     }
     $this->errorDesignPath = 'error/index/index.tpl';
     echo "<pre>";
     echo $this->errorText;
     die;
 }
예제 #12
0
 public function __construct($message, $code = 0, $messageToLogFile = NULL)
 {
     parent::__construct($message, $code, $messageToLogFile);
     if (__ENABLE_DEBUG__ == 0) {
         App::redirect('admin/mainside');
     }
     $this->errorDesignPath = 'error/index/index.tpl';
     App::getModel('template')->assign('SHOP_NAME', App::getRegistry()->session->getActiveShopName());
     App::getModel('template')->assign('error', preg_replace('/(\\n|\\r)+/', '\\n', nl2br(addslashes($this->errorText))));
     App::getModel('template')->display($this->errorDesignPath);
     die;
 }
예제 #13
0
 public function __construct($message, $code = 0, $messageToLogFile = NULL)
 {
     parent::__construct($message, $code, $messageToLogFile);
     if (__ENABLE_DEBUG__ == 0) {
         App::redirectSeo(App::getURLAdress());
     }
     App::getModel('template')->assign('SHOP_NAME', App::getRegistry()->session->getActiveShopName());
     App::getModel('template')->assign('error', $this->errorText);
     App::getModel('template')->assign('BASE_URL', App::getURLAdress());
     App::getModel('template')->display('error/index/layout.tpl');
     die;
 }
예제 #14
0
 public function __construct(\BaseException $e)
 {
     if ($e instanceof \ParseException) {
         $message = 'Parse error: ' . $e->getMessage();
         $severity = E_PARSE;
     } elseif ($e instanceof \TypeException) {
         $message = 'Type error: ' . $e->getMessage();
         $severity = E_RECOVERABLE_ERROR;
     } else {
         $message = 'Fatal error: ' . $e->getMessage();
         $severity = E_ERROR;
     }
     \ErrorException::__construct($message, $e->getCode(), $severity, $e->getFile(), $e->getLine());
     $this->setTrace($e->getTrace());
 }
예제 #15
0
파일: Template.php 프로젝트: atk4/atk4
 public function init()
 {
     parent::init();
     if (isset($this->owner) && isset($this->owner->template_file)) {
         $this->addMoreInfo('file', $this->owner->template_file);
     }
     $keys = array_keys($this->owner->tags);
     if (!empty($keys)) {
         $this->addMoreInfo('keys', implode(', ', $keys));
     }
     if (isset($this->owner->source)) {
         $this->addMoreInfo('source', $this->owner->source);
     }
 }
예제 #16
0
 function __construct($last_query = '', $message = null, $func = null, $shift = 1)
 {
     $last_query = htmlentities($last_query);
     $mysql_error = mysql_error();
     $cause = preg_replace('/.*near \'(.*)\' at line .*/', '\\1', $mysql_error);
     if ($cause != $mysql_error) {
         $last_query = str_replace($cause, "<font color=blue><b>" . $cause . "</b></font>", $last_query);
     }
     list($message) = explode('select', $message);
     $msg = '<p>' . $message . '</p>';
     if ($mysql_error) {
         $msg .= ($last_query == '' ? "" : "<b>Last query:</b> <div style='border: 1px solid black'>" . $last_query . "</div>") . "<b>MySQL error:</b> <div style='border: 1px solid black'><font color=red>" . $mysql_error . "</font></div>";
     }
     parent::__construct($msg, $func, $shift);
 }
예제 #17
0
파일: Error.php 프로젝트: nstielau/drops-8
 /**
  * Decodes an exception and retrieves the correct caller.
  *
  * @param \Exception|\BaseException $exception
  *   The exception object that was thrown.
  *
  * @return array
  *   An error in the format expected by _drupal_log_error().
  */
 public static function decodeException($exception)
 {
     $message = $exception->getMessage();
     $backtrace = $exception->getTrace();
     // Add the line throwing the exception to the backtrace.
     array_unshift($backtrace, array('line' => $exception->getLine(), 'file' => $exception->getFile()));
     // For PDOException errors, we try to return the initial caller,
     // skipping internal functions of the database layer.
     if ($exception instanceof \PDOException || $exception instanceof DatabaseExceptionWrapper) {
         // The first element in the stack is the call, the second element gives us
         // the caller. We skip calls that occurred in one of the classes of the
         // database layer or in one of its global functions.
         $db_functions = array('db_query', 'db_query_range');
         while (!empty($backtrace[1]) && ($caller = $backtrace[1]) && (isset($caller['class']) && (strpos($caller['class'], 'Query') !== FALSE || strpos($caller['class'], 'Database') !== FALSE || strpos($caller['class'], 'PDO') !== FALSE) || in_array($caller['function'], $db_functions))) {
             // We remove that call.
             array_shift($backtrace);
         }
         if (isset($exception->query_string, $exception->args)) {
             $message .= ": " . $exception->query_string . "; " . print_r($exception->args, TRUE);
         }
     }
     $caller = static::getLastCaller($backtrace);
     return array('%type' => get_class($exception), '!message' => SafeMarkup::checkPlain($message), '%function' => $caller['function'], '%file' => $caller['file'], '%line' => $caller['line'], 'severity_level' => static::ERROR, 'backtrace' => $backtrace);
 }
 public function __construct($name = "", $message = "", \Exception $previous = null)
 {
     $this->name = $name;
     parent::__construct($message, Globals::EXCEPTION_ERROR_ARGUMENT_INVALID, $previous);
 }
 /**
  * UnknownRequestException constructor.
  *
  * @param string $type
  */
 public function __construct($type)
 {
     parent::__construct();
     $this->_type = $type;
 }
예제 #20
0
 public function __construct($message = "", $code = 0, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
 }
 function __construct($write_log = false, $write_hdd_session = false, $write_hdd_sql = false, $message = null, $additional_information = null)
 {
     parent::__construct($write_log, $write_hdd_session, $write_hdd_sql, $message, $additional_information);
 }
예제 #22
0
 /**
  * @param string $class
  * @param string $property
  */
 public function __construct($class, $property)
 {
     parent::__construct("Trying to set a read-only property ({$class}::{$property}) on {{guiltyFile}} at line {{guiltyLine}}");
 }
예제 #23
0
 public function __construct($controller, $action, $message = "", \Exception $previous = null)
 {
     parent::__construct($message, Globals::EXCEPTION_ERROR_WEB, $previous);
     $this->controller = $controller;
     $this->action = $action;
 }
예제 #24
0
 public function __construct($message, $code = 0)
 {
     parent::__construct($message, $code);
 }
 public function __construct(array $parameters = array())
 {
     parent::__construct($parameters);
     $message = sprintf("ERROR: the '%s' entity with '%s = %s' does not exist in the database.\n\n", $parameters['entity']['name'], $parameters['entity']['primary_key_field_name'], $parameters['entity_id']);
     $this->setMessage($message);
 }
예제 #26
0
 public function __construct($parameters) {
     parent::__construct(__CLASS__, $parameters);
 }
예제 #27
0
 /**
  * @param string $message
  */
 public function __construct($message)
 {
     parent::__construct($message);
 }
 public function __construct(array $parameters = array())
 {
     $errorMessage = sprintf('The requested "%s" action is not allowed for the "%s" entity.', $parameters['action'], $parameters['entity']);
     $proposedSolution = sprintf('Remove the "%s" action from the "disabled_actions" option, which can be configured globally for the entire backend or locally for the "%s" entity.', $parameters['action'], $parameters['entity']);
     parent::__construct($errorMessage, $proposedSolution, 403);
 }
예제 #29
0
파일: Stop.php 프로젝트: easyconn/atk4
 function __construct($msg = null)
 {
     parent::__construct($msg ?: 'This exception must be ignored in APP');
 }
예제 #30
0
 public function __construct($message, $field = 0)
 {
     parent::__construct($message, self::VALIDATION_FAILED);
     $this->setField($field);
 }