Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Debug\Exception; Chris@0: Chris@0: /** Chris@0: * Fatal Throwable Error. Chris@0: * Chris@0: * @author Nicolas Grekas
Chris@0: */ Chris@0: class FatalThrowableError extends FatalErrorException Chris@0: { Chris@0: public function __construct(\Throwable $e) Chris@0: { Chris@0: if ($e instanceof \ParseError) { Chris@0: $message = 'Parse error: '.$e->getMessage(); Chris@0: $severity = E_PARSE; Chris@0: } elseif ($e instanceof \TypeError) { Chris@0: $message = 'Type error: '.$e->getMessage(); Chris@0: $severity = E_RECOVERABLE_ERROR; Chris@0: } else { Chris@0: $message = $e->getMessage(); Chris@0: $severity = E_ERROR; Chris@0: } Chris@0: Chris@0: \ErrorException::__construct( Chris@0: $message, Chris@0: $e->getCode(), Chris@0: $severity, Chris@0: $e->getFile(), Chris@13: $e->getLine(), Chris@13: $e->getPrevious() Chris@0: ); Chris@0: Chris@0: $this->setTrace($e->getTrace()); Chris@0: } Chris@0: }