Exemple #1
0
 public function __construct($message = '', $code = 0, \Exception $previous = NULL)
 {
     if ($code < 200 || $code > 504) {
         $code = $this->defaultCode;
     }
     parent::__construct($message, $code, $previous);
 }
Exemple #2
0
 /**
  * Override the default Exception class constructor
  * Take the file name and the Error code and create a new Exception
  *
  * @param string $fileName
  * @param int $httpErrorCode HTTP error code
  */
 public function __construct($fileName, $httpErrorCode)
 {
     $this->httpErrorCode = $httpErrorCode;
     $message = "Attempting to access {$fileName} resulted in {$httpErrorCode}";
     parent::__construct($message, E_USER_NOTICE, 'File not found.');
 }