/** * {@inheritdoc} */ public function execute(\Exception $exception) { error_log($exception->getMessage() . " " . $exception->getFile() . "(" . $exception->getLine() . ")"); if (!$this->environment->isDebug()) { return; } $presenter = new HTTPErrorPresenter($this->environment); $response = new Response(); $response->setContent($exception); $request = new EmptyRequest('', null); $presenter->render($request, $response); }
/** * {@inheritdoc} */ public function execute(\Exception $exception) { if (!$this->dependencyInjection->get('environment')->isSilent()) { error_log($exception->getMessage() . " " . $exception->getFile() . "(" . $exception->getLine() . ")"); } $presenter = $this->getPresenter($this->request->getUrl()); $response = new Response(); $response->setStatusCode(500); $response->setContent($exception); if ($exception instanceof HTTPException) { $response->setStatusCode($exception->getStatusCode()); } $event = new ExecutePresenterEvent($this->request, $response); $this->dependencyInjection->get('eventManager')->fire('executePresenter', $event); $presenter->render($this->request, $response); }
/** * Constructor. * * @param int $position * @param string $name */ public function __construct($position, $name) { parent::__construct(100 + $position, 'Required argument "' . $name . '".'); }
/** * {@inheritdoc} */ public function execute(\Exception $exception) { echo $exception->getMessage(); }
/** * Constructor. * * @param string $name field name */ public function __construct($name) { parent::__construct(4, 'Field "' . $name . '" not found.', 'Internal server error.'); }
/** * Constructor. * * @param int $position * @param string $name * @param string $message */ public function __construct($position, $name, $message) { parent::__construct(200 + $position, 'Invalid argument "' . $name . '": ' . $message); }
/** * Constructor. */ public function __construct() { parent::__construct(311, 'Permission denied'); }
/** * Constructor. * * @param int $maxSize */ public function __construct($maxSize) { parent::__construct(17, 'Max size for file is too large. Server limit: ' . $maxSize . '.'); }
/** * Constructor. * * @param string $mapperName */ public function __construct($mapperName) { parent::__construct(4, 'Mapper "' . $mapperName . '" not found.', 'Internal server error.'); }