You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- You may use exceptions within the standard throwing/catching mechanism or even extend them in any way you want:
20
20
21
21
```php
22
-
use Bsadnu\Exception\InvalidArgumentException;
22
+
use Bsadnu\Exception\Base\InvalidArgumentException;
23
23
24
24
...
25
25
@@ -31,26 +31,24 @@ try {
31
31
```
32
32
33
33
```php
34
-
use Bsadnu\Exception\TypeError;
34
+
use Bsadnu\Exception\Base\TypeError;
35
35
36
36
...
37
37
38
38
throw new TypeError($message);
39
39
```
40
40
41
-
- It is really helpful to catch the base `ExceptionInterface` sometimes. Therefore, you can control a group of exceptions. Moreover, you may add manually as many specific interfaces as you wish.
41
+
- It is really helpful to catch either the base `BaseInterface` or any other. Therefore, you can control a group of exceptions. Moreover, you may add manually as many specific interfaces as you wish.
42
42
43
43
## More detailed description
44
44
45
-
All exceptions used in this library implements `\Bsadnu\Exception\ExceptionInterface`, and extend one of the SPL extensions. This way, you have several ways of catching specific extension groups:
45
+
All exceptions used in this library implements `\Bsadnu\Exception\Interfaces\BaseInterface`, and extend one of the SPL extensions. This way, you have several ways of catching specific extension groups:
46
46
1. Catch all exceptions: `\Exception`
47
47
2. Catch all exceptions thrown by the library:
48
-
`\Bsadnu\Exception\ExceptionInterface`
48
+
`\Bsadnu\Exception\Interfaces\BaseInterface`
49
49
3. Catch a specific SPL exception: `\LogicException`
50
-
4. Catch a specific SPL exception thrown by the library:
51
-
`\Bsadnu\Exception\LogicException`
52
-
53
-
The base `\Bsadnu\Exception\ExceptionInterface` consists of `getUnit/setUnit` methods which can be used to describe the place of code (Unit) where an exception occurs.
50
+
4. Catch a specific exception thrown by the library:
0 commit comments