Re-instantiates Exceptions thrown by user-space code to retain their original class names, properties, and stack traces (but without arguments). Unlike PHPUnit_Framework_Exception, the complete stack of previous Exceptions is processed.
Author: Daniel F. Kudwien (sun@unleashedmind.com)
Inheritance: extends PHPUnit_Framework_Exception
コード例 #1
0
ファイル: ExceptionWrapper.php プロジェクト: cargomedia/cm
 public function __construct(CM_Exception $e)
 {
     parent::__construct($e);
     $formatter = new CM_ExceptionHandling_Formatter_Plain();
     $serializedException = new CM_ExceptionHandling_SerializableException($e);
     $this->message = get_class($e) . ': ' . $e->getMessage() . PHP_EOL . $formatter->getMetaInfo($serializedException);
 }
コード例 #2
0
 /**
  * @param RequestException $e
  */
 public function __construct(RequestException $e)
 {
     $this->wrappedException = $e;
     parent::__construct($e);
 }