nette/nette — pull request #1148 by mzk (2013-06-25 08:34:44+00:00)
Title: Exceptions: change inheritance

ForbiddenRequestException is not instance of BadRequestException

On nette.org I found example ErrorPresenter
isAjax()) {
$this->getPayload()->error = TRUE;
$this->terminate();

} elseif ($exception instanceof BadRequestException) {
$this->setView('404');

} else {
$this->setView('500');
Debug::processException($exception);
}
}
?>
If I decide to distinguish different Exceptions, it works, but not ForbiddenRequestException.
isAjax()) {
$this->getPayload()->error = TRUE;
$this->terminate();

} elseif ($exception instanceof BadRequestException) {
$this->setView('404');

} elseif ($exception instanceof ForbiddenRequestException) { /*never, because is instance of BadRequestException */
$this->setView('403'); //logout message,upgrade membership message etc.
} else {
$this->setView('500');
Debug::processException($exception);
}
}
?>