1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (http://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: if ($code < 200 || $code > 504) {
50: $code = $this->defaultCode;
51: }
52:
53: {
54: parent::__construct($message, $code, $previous);
55: }
56: }
57:
58: }
59:
60:
61: /**
62: * Forbidden request exception - access denied.
63: */
64: class ForbiddenRequestException extends BadRequestException
65: {
66: /** @var int */
67: protected $defaultCode = 403;
68:
69: }
70: