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: * @package Nette
11: */
12:
13:
14:
15: /**
16: * The exception that is thrown when the value of an argument is
17: * outside the allowable range of values as defined by the invoked method.
18: * @package Nette
19: */
20: class ArgumentOutOfRangeException extends InvalidArgumentException
21: {
22: }
23:
24:
25: /**
26: * The exception that is thrown when a method call is invalid for the object's
27: * current state, method has been invoked at an illegal or inappropriate time.
28: * @package Nette
29: */
30: class InvalidStateException extends RuntimeException
31: {
32: public function __construct($message = '', $code = 0, Exception $previous = NULL)
33: {
34: if (PHP_VERSION_ID < 50300) {
35: $this->previous = $previous;
36: parent::__construct($message, $code);
37: } else {
38: parent::__construct($message, $code, $previous);
39: }
40: }
41: }
42:
43:
44: /**
45: * The exception that is thrown when a requested method or operation is not implemented.
46: * @package Nette
47: */
48: class NotImplementedException extends LogicException
49: {
50: }
51:
52:
53: /**
54: * The exception that is thrown when an invoked method is not supported. For scenarios where
55: * it is sometimes possible to perform the requested operation, see InvalidStateException.
56: * @package Nette
57: */
58: class NotSupportedException extends LogicException
59: {
60: }
61:
62:
63: /**
64: * The exception that is thrown when a requested method or operation is deprecated.
65: * @package Nette
66: */
67: class DeprecatedException extends NotSupportedException
68: {
69: }
70:
71:
72: /**
73: * The exception that is thrown when accessing a class member (property or method) fails.
74: * @package Nette
75: */
76: class MemberAccessException extends LogicException
77: {
78: }
79:
80:
81: /**
82: * The exception that is thrown when an I/O error occurs.
83: * @package Nette
84: */
85: class IOException extends RuntimeException
86: {
87: }
88:
89:
90: /**
91: * The exception that is thrown when accessing a file that does not exist on disk.
92: * @package Nette
93: */
94: class FileNotFoundException extends IOException
95: {
96: }
97:
98:
99: /**
100: * The exception that is thrown when part of a file or directory cannot be found.
101: * @package Nette
102: */
103: class DirectoryNotFoundException extends IOException
104: {
105: }
106:
107:
108: /**
109: * The exception that is thrown when static class is instantiated.
110: * @package Nette
111: */
112: class StaticClassException extends LogicException
113: {
114: }
115:
116:
117: /**
118: * The exception that indicates errors that can not be recovered from. Execution of
119: * the script should be halted.
120: * @package Nette
121: */
122: class FatalErrorException extends Exception // ErrorException is corrupted in PHP < 5.3
123: {
124: private $severity;
125:
126: public function __construct($message, $code, $severity, $file, $line, $context, Exception $previous = NULL)
127: {
128: if (PHP_VERSION_ID < 50300) {
129: $this->previous = $previous;
130: parent::__construct($message, $code);
131: } else {
132: parent::__construct($message, $code, $previous);
133: }
134: $this->severity = $severity;
135: $this->file = $file;
136: $this->line = $line;
137: $this->context = $context;
138: }
139:
140: public function getSeverity()
141: {
142: return $this->severity;
143: }
144:
145: }
146: