Exception Handling
Throw/catch
This is the basic structure:
- Throwing exceptions: Php can look for functions to handle problems if they come up in your programs. This is called "throwing an exception".
- The error-handling function "catches the exception."
- This makes it easy to identify and report exeption errors.
This is the basic structure:
- Try a piece of code
- In case of error (failure), throw an exception
- An error handler (which had been assigned to the type of exception thrown) catches it and "deals with it".
- Clean up resources used

0 Comments:
Post a Comment
<< Home