public static function createFromException(\Exception $e) { if ($e instanceof FormattedException) { return $e; } $code = $e->getCode(); $exception = new FormattedException(sprintf('Wrapped %s: %s', get_class($e), $e->getMessage()), $code != 0 ? $code : 500); $exception->setWrappedException($e); return $exception; }
function __construct($classname) { parent::__construct('Could not find class ' . $classname, 500); }