Not catched exception

L

lionheart

Hi everyone,
what happens if a methode B don't catch an exception? Will it be passed
on to the methode A that called B? Or does it have to be rethrown at
each level? Is there an applicationwidth handler for uncatched
exceptions? Are there differences in implementations (like e.g. VS 6)?

Thanks a lot in advance,
Thomas
 
V

Victor Bazarov

lionheart said:
what happens if a methode B don't catch an exception?

Exception is caught by the most inner 'catch' clause that is currently
registered in the exception handling mechanism and whose exception spec
matches the exception thrown. If there isn't any, the exception is not
caught at all, and usually the program is simply terminated. What book
on C++ are you reading that doesn't explain that?
Will it be
passed on to the methode A that called B?

Exceptions are caught, and stack is unwound, in a very specific manner.
What book on C++ are you reading that doesn't explain that?
Or does it have to be
rethrown at each level?

No, it does not. What book on C++ are you reading that doesn't explain
that?
Is there an applicationwidth handler for
uncatched exceptions?

Yes, it's called 'terminate'.
Are there differences in implementations (like
e.g. VS 6)?

There probably are.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top