Jump to content

Trouble understanding exception concept of catching errors?


inVINCEable

Recommended Posts

Hello everyone,

 

I have a bit of a general question. I am having trouble wrapping my head around the general concept of catching errors. I have read the tutorials about exceptions on DevShed, as well as on Zend's website. It is still not clear to me. If I throw 5 exceptions, how come I need 5 catch phrases, and what does it mean when it travels up the stack? Sorry I am just really confused with the catch phrases and how they work, although I am almost positive I completely understand the throwing of exception concept.

 

Thank you for any time you take in advising.

 

Link to comment
Share on other sites

If you throw 5 different kinds of execeptions then you need 5 catches in place ready to catch each different exception. if your exceptions are not caught by a defined catch then you will get the 'uncaught exception' error. The stack literally refers to the way with which exceptions are caught. Each exception will treverse the stack of catches untill it is eather caught or comes to the end.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.