1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
<?php
namespace BaseModule;
use Nette\Diagnostics\Debugger,
Nette\Application as NA;
/**
* Error presenter
*/
class ErrorPresenter extends \BaseModule\BasePresenter {
/**
* Renders default error
*
* @param Exception
*/
public function renderDefault($exception) {
if ($this->isAjax()) { // AJAX request? Just note this error in payload.
$this->payload->error = TRUE;
$this->terminate();
} else {
$this->setView('error'); // load templates
Debugger::log($exception, Debugger::ERROR); // and log exception
}
}
}