Пример #1
0
 public function __construct(Exception $original)
 {
     $msg = get_class($original) . ': ' . $original->getMessage();
     $code = $original->getCode();
     parent::__construct($msg, $code);
     $this->setBacktrace(SimpleSAML_Utilities::buildBacktrace($original));
 }
Пример #2
0
 /**
  * Constructor for this error.
  *
  * Note that the cause will be converted to a SimpleSAML_Error_UnserializableException
  * unless it is a subclass of SimpleSAML_Error_Exception.
  *
  * @param string $message Exception message
  * @param int $code Error code
  * @param Exception|NULL $cause  The cause of this exception.
  */
 public function __construct($message, $code = 0, Exception $cause = NULL)
 {
     assert('is_string($message)');
     assert('is_int($code)');
     parent::__construct($message, $code);
     $this->backtrace = SimpleSAML_Utilities::buildBacktrace($this);
     if ($cause !== NULL) {
         if (!$cause instanceof SimpleSAML_Error_Exception) {
             $cause = new SimpleSAML_Error_UnserializableException($cause);
         }
         $this->cause = $cause;
     }
 }