Example #1
0
 /**
  * @param string $message
  * @param int $code
  * @param \Exception|int $logLevel
  * @param \Exception|null $previous
  */
 public function __construct($message = "", $code = 0, $logLevel = LogLevel::ERROR, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
     if (LogLevel::isValidLevel($logLevel)) {
         $this->logLevel = $logLevel;
     } else {
         $this->logLevel = LogLevel::ERROR;
     }
 }
Example #2
0
 /**
  * Class constructor
  * 
  * @param   string $errMsg  error message (used for frontend/enduser display, too)    
  * @param   string $debugMsg detailed debug message (not used for frontend display)  
  */
 public function __construct($errMsg = '', $debugMsg = '')
 {
     parent::__construct($errMsg, 0, $debugMsg);
 }
Example #3
0
 /**
  * Class constructor: sets internal properties and calls the parent constructor (Exception::__construct(...)
  *
  * @param string $errMsg
  * @param int $errCode
  * @param string $debugMsg
  * @internal param optional $string error message (used for frontend/enduser display, too)
  * @internal param optional $string detailed debug message (not used for frontend display). For database errors (error code 1) the last TYPO3 DB SQL error is set to the debug message by default. To suppress this or to trace another DB object's SQL error use the third param to replace this default.
  */
 public function __construct($errMsg = '', $errCode = 0, $debugMsg = '')
 {
     $this->debugMsg = $debugMsg;
     // handle different error types ("old" switch structure remains for backwards compatibility)
     switch ($errCode) {
         case self::EXCP_DATABASE:
             $this->errType = 'DATABASE ERROR';
             break;
         case self::EXCP_CONFIG:
             $this->errType = 'CONFIGURATION ERROR';
             break;
         case self::EXCP_INTERNAL:
             $this->errType = 'INTERNAL ERROR';
             break;
         case self::EXCP_AUTH:
             $this->errType = 'AUTHENTICATION ERROR';
             break;
         case self::EXCP_WEBSERVICE:
             $this->errType = 'WEBSERVICE ERROR';
             break;
         default:
             $this->errType = 'ERROR';
             break;
     }
     // write to devlog
     if (TYPO3_DLOG) {
         GeneralUtility::devLog($this->getMessage(), 'pt_extbase', 1, array('exceptionClass' => get_class($this), 'debugMsg' => $this->debugMsg, 'file' => $this->getFile(), 'line' => $this->getLine(), 'code' => $this->getCode(), 'trace' => $this->getTraceAsString()));
     }
     // call parent constructor to make sure everything is assigned properly
     parent::__construct($errMsg, $errCode);
 }