Symfony\Component\Debug\Exception\FlattenException::getCode PHP Method

getCode() public method

public getCode ( )
    public function getCode()
    {
        return $this->code;
    }

Usage Example

 /**
  * Converts an Exception to a Response.
  *
  * @param  Request          $request
  * @param  FlattenException $exception
  * @return Response
  */
 public function showAction(Request $request, FlattenException $exception)
 {
     if (is_subclass_of($exception->getClass(), 'Pagekit\\Kernel\\Exception\\HttpException')) {
         $title = $exception->getMessage();
     } else {
         $title = __('Whoops, looks like something went wrong.');
     }
     $content = $this->getAndCleanOutputBuffering($request->headers->get('X-Php-Ob-Level', -1));
     $response = App::view('system/error.php', compact('title', 'exception', 'content'));
     return App::response($response, $exception->getCode(), $exception->getHeaders());
 }
All Usage Examples Of Symfony\Component\Debug\Exception\FlattenException::getCode