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.

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.