1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette\Application;
9:
10: use Nette;
11:
12:
13: /**
14: * The exception that is thrown when user attempts to terminate the current presenter or application.
15: * This is special "silent exception" with no error message or code.
16: */
17: class AbortException extends \Exception
18: {
19: }
20:
21:
22: /**
23: * Application fatal error.
24: */
25: class ApplicationException extends \Exception
26: {
27: }
28:
29:
30: /**
31: * The exception that is thrown when a presenter cannot be loaded.
32: */
33: class InvalidPresenterException extends \Exception
34: {
35: }
36:
37:
38: /**
39: * Bad HTTP / presenter request exception.
40: */
41: class BadRequestException extends \Exception
42: {
43: /** @var int */
44: protected $defaultCode = 404;
45:
46:
47: public function __construct($message = '', $code = 0, \Exception $previous = NULL)
48: {
49: parent::__construct($message, $code < 200 || $code > 504 ? $this->defaultCode : $code, $previous);
50: }
51:
52: }
53:
54:
55: /**
56: * Forbidden request exception - access denied.
57: */
58: class ForbiddenRequestException extends BadRequestException
59: {
60: /** @var int */
61: protected $defaultCode = 403;
62:
63: }
64: