O_o

Yes. It does. It is almost identical in C++. The primary difference (I'm guessing as I don't know exactly how it works in C#.) is that in C++ the `catch' variable should always be a reference (&).

That said, please don't do this. It is a sign of misunderstanding how exceptions best work.

What are you trying to accomplish?

Saying "handle it at more than one level" is not sufficient as that statement is flawed. If you handle an exception at one level it has no business being propagated higher as it has already been handled.

If you need to transform an exception because the error has been handled at a level where the existence of the error signals an entirely different form of failure a different exception should be thrown.

If you need to add context to an exception, your exception class and point of origin are probably flawed. This can be overlooked if you need to add context to the exception at a higher level because lower level facilities aren't controlled by you.

If you need to handle a particular flavor of exception by inspecting the attributes of an instance of the exception class you do not have enough exception classes to do the job. The point of the `catch' variable is so that one might handle exactly that error condition. In general, you can assume that one class for each flavor of exception is correct.

Soma