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