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: * The exception that is thrown when user attempts to terminate the current presenter or application.
19: * This is special "silent exception" with no error message or code.
20: */
21: class AbortException extends \Exception
22: {
23: }
24:
25:
26: /**
27: * Application fatal error.
28: */
29: class ApplicationException extends \Exception
30: {
31: }
32:
33:
34: /**
35: * The exception that is thrown when a presenter cannot be loaded.
36: */
37: class InvalidPresenterException extends \Exception
38: {
39: }
40:
41:
42: /**
43: * Bad HTTP / presenter request exception.
44: */
45: class BadRequestException extends \Exception
46: {
47: /** @var int */
48: protected $defaultCode = 404;
49:
50:
51: public function __construct($message = '', $code = 0, \Exception $previous = NULL)
52: {
53: if ($code < 200 || $code > 504) {
54: $code = $this->defaultCode;
55: }
56:
57: {
58: parent::__construct($message, $code, $previous);
59: }
60: }
61:
62: }
63:
64:
65: /**
66: * Forbidden request exception - access denied.
67: */
68: class ForbiddenRequestException extends BadRequestException
69: {
70: /** @var int */
71: protected $defaultCode = 403;
72:
73: }
74: