Ouzo\ExceptionHandling\OuzoExceptionData::forException PHP Method

forException() public static method

public static forException ( $httpCode, Exception $exception )
$exception Exception
    public static function forException($httpCode, Exception $exception)
    {
        return new OuzoExceptionData($httpCode, array(Error::forException($exception)), $exception->getTraceAsString());
    }

Usage Example

Example #1
0
 public function runDefaultHandler($exception)
 {
     if ($this->needPrettyHandler()) {
         $run = new Run();
         $run->pushHandler(new PrettyPageHandler());
         $run->handleException($exception);
     } else {
         $this->handleError(OuzoExceptionData::forException(500, $exception));
     }
 }
All Usage Examples Of Ouzo\ExceptionHandling\OuzoExceptionData::forException