Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Basic Exception Handling with PHP!
You have completed Basic Exception Handling with PHP!
Preview
There are times when we would like our application to throw its own exceptions. Such as when a resource, like a file or a database, that SHOULD be available isn't.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
There are other times when we would
like our application to throw its
0:00
own exceptions as well.
0:00
Such as when a resource, like a file or a
database that should be available, isn't.
0:02
Remember, this should not be used in
the normal flow of an application, but
0:08
only when something exceptional happens.
0:13
Let's go into work spaces and
throw our own exceptions.
0:15
Let's try reading a file
that doesn't exist.
0:19
Start with a new file named data.php.
0:22
Open your php tag and echo a line for
the end of the file so
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up