Manually implemented #310 from @Trismegiste.

This commit is contained in:
Phil Sturgeon
2014-03-23 17:53:15 -04:00
parent 928cde7430
commit 5ef51c5626

View File

@@ -16,8 +16,8 @@ looking for a mistake and check the docs to see what the error method is for thi
obvious.
Another problem is when classes automatically throw an error to the screen and exit the process. When you do this you
stop another developer from being able to dynamically handle that error. Exceptions should be thrown to make a developer aware
of an error; they then can choose how to handle this. E.g.:
stop another developer from being able to dynamically handle that error. Exceptions should be thrown to make a developer
aware of an error; they then can choose how to handle this. E.g.:
{% highlight php %}
<?php
@@ -59,7 +59,7 @@ the creation of a <em>lot</em> of custom Exceptions, some of which could have be
provided in the [SPL extension][splext].
If for example you use the `__call()` Magic Method and an invalid method is requested then instead of throwing a standard
Exception which is vague, or creating a custom Exception just for that, you could just `throw new BadFunctionCallException;`.
Exception which is vague, or creating a custom Exception just for that, you could just `throw new BadMethodCallException;`.
* [Read about Exceptions][exceptions]
* [Read about SPL Exceptions][splexe]