Hi I'm looking for a very simple code snippet.
I have a program written, and if there is a fatal error I want it to stop and output some text.
Something like:
try
{
//program here
}catch
{
echo "We're sorry contact the site administer blah blah blah";
}
So far I have only been able to find error handling where you script an exception to be thrown in a specific instance. I don't want to do this. I could never be sure if I found ever possible problem. If there is a general error I want the program to stop and output a generic message.
Can you please post the code for this?