4
* This file is part of the Nette Framework (http://nette.org)
6
* Copyright (c) 2004 David Grudl (http://davidgrudl.com)
8
* For the full copyright and license information, please view
9
* the file license.txt that was distributed with this source code.
12
namespace NetteModule;
16
Nette\Diagnostics\Debugger;
20
* Default Error Presenter.
24
class ErrorPresenter extends Nette\Object implements Application\IPresenter
28
* @return Application\IResponse
30
public function run(Application\Request $request)
32
$e = $request->parameters['exception'];
33
if ($e instanceof Application\BadRequestException) {
34
$code = $e->getCode();
37
Debugger::log($e, Debugger::ERROR);
40
require __DIR__ . '/templates/error.phtml';
41
return new Application\Responses\TextResponse(ob_get_clean());