1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004, 2011 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: // no namespace
13:
14:
15:
16: /*
17: some useful SPL exception:
18:
19: - LogicException
20: - InvalidArgumentException
21: - LengthException
22: - RuntimeException
23: - OutOfBoundsException
24: - UnexpectedValueException
25:
26: other SPL exceptions are ambiguous; do not use them
27:
28: ErrorException is corrupted in PHP < 5.3
29: */
30:
31:
32:
33: /**
34: * The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method.
35: */
36: class ArgumentOutOfRangeException extends InvalidArgumentException
37: {
38: }
39:
40:
41:
42: /**
43: * The exception that is thrown when a method call is invalid for the object's current state, method has been invoked at an illegal or inappropriate time.
44: */
45: class InvalidStateException extends RuntimeException
46: {
47: }
48:
49:
50:
51: /**
52: * The exception that is thrown when a requested method or operation is not implemented.
53: */
54: class NotImplementedException extends LogicException
55: {
56: }
57:
58:
59:
60: /**
61: * The exception that is thrown when an invoked method is not supported.
62: * For scenarios where it is sometimes possible to perform the requested operation, see InvalidStateException.
63: */
64: class NotSupportedException extends LogicException
65: {
66: }
67:
68:
69:
70: /**
71: * The exception that is thrown when a requested method or operation is deprecated.
72: */
73: class DeprecatedException extends NotSupportedException
74: {
75: }
76:
77:
78:
79: /**
80: * The exception that is thrown when accessing a class member (property or method) fails.
81: */
82: class MemberAccessException extends LogicException
83: {
84: }
85:
86:
87:
88: /**
89: * The exception that is thrown when an I/O error occurs.
90: */
91: class IOException extends RuntimeException
92: {
93: }
94:
95:
96:
97: /**
98: * The exception that is thrown when accessing a file that does not exist on disk.
99: */
100: class FileNotFoundException extends IOException
101: {
102: }
103:
104:
105:
106: /**
107: * The exception that is thrown when part of a file or directory cannot be found.
108: */
109: class DirectoryNotFoundException extends IOException
110: {
111: }
112:
113:
114:
115: /**
116: * The exception that indicates errors that can not be recovered from.
117: * Execution of the script should be halted.
118: */
119:
120: class FatalErrorException extends ErrorException
121: {
122:
123: public function __construct($message, $code, $severity, $file, $line, $context)
124: {
125: parent::__construct($message, $code, $severity, $file, $line);
126: $this->context = $context;
127: }
128:
129: }
130:
131:
132: