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