当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseException类代码示例

本文整理汇总了PHP中BaseException的典型用法代码示例。如果您正苦于以下问题:PHP BaseException类的具体用法?PHP BaseException怎么用?PHP BaseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BaseException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetTraceError

 public function GetTraceError()
 {
     $msg = null;
     if ($this->_lastError instanceof BaseException) {
         $msg = $this->_lastError->getTraceAsString();
     }
     return $msg;
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:8,代码来源:base_manager.php

示例2: __construct

 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());
 }
开发者ID:hilmysyarif,项目名称:sisfito,代码行数:15,代码来源:FatalBaseException.php

示例3: decodeException

 /**
  * 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);
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:33,代码来源:Error.php

示例4: __construct

 public function __construct($message = "", $code = 404, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_MODEL_ERR_COULDNOTLOAD');
     }
     parent::__construct($message, $code, $previous);
 }
开发者ID:Joal01,项目名称:fof,代码行数:7,代码来源:RecordNotLoaded.php

示例5: __construct

 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);
 }
开发者ID:Zyr93,项目名称:DiamondMVC,代码行数:26,代码来源:LanguageNotFoundException.php

示例6: __construct

 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);
 }
开发者ID:rkueny,项目名称:EasyAdminBundle,代码行数:7,代码来源:NoEntitiesConfiguredException.php

示例7: __construct

 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);
 }
开发者ID:rkueny,项目名称:EasyAdminBundle,代码行数:7,代码来源:ForbiddenActionException.php

示例8: __construct

 public function __construct($message = '', $code = 500, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_MODEL_ERR_CANNOTLOCKNOTLOADEDRECORD');
     }
     parent::__construct($message, $code, $previous);
 }
开发者ID:Joal01,项目名称:fof,代码行数:7,代码来源:CannotLockNotLoadedRecord.php

示例9: __construct

 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);
 }
开发者ID:rkueny,项目名称:EasyAdminBundle,代码行数:7,代码来源:UndefinedEntityException.php

示例10: __construct

 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);
 }
开发者ID:remysanfeliu,项目名称:GEM,代码行数:7,代码来源:NotImplementedException.php

示例11: __construct

 /**
  * 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);
 }
开发者ID:kamranahmedse,项目名称:laravel-faulty,代码行数:16,代码来源:NotFoundException.php

示例12:

 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);
 }
开发者ID:xavocvijay,项目名称:atkschool,代码行数:11,代码来源:Exception.php

示例13: __construct

 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;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:11,代码来源:AdminException.php

示例14: __construct

 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;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:12,代码来源:CoreException.php

示例15: __construct

 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;
 }
开发者ID:krisldz,项目名称:Gekosale2,代码行数:12,代码来源:FrontendException.php


注:本文中的BaseException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。