Re: Exceptions creating Exceptional Problems!

Abhijit Menon-Sen <[email protected]> Mon, 10 Jan 2005 08:22:17 +0530
Newsgroups gmane.user-groups.linux.delhi.devel
Message-ID <[email protected]>
At 2005-01-09 16:58:42 -0500, [email protected] wrote:
>
> I think, this shall work now,
> 
> Socket *s;
> try
> {
>   s=new Socket(args);
>   s->do_something();
> }
> catch(...)
> {
>   s->what_happened();
> }

Not if your Socket constructor throws an exception. As I said:

> > Of course, if it is the constructor that's throwing an exception, what
> > do you hope to do with the "object" when you catch that exception? It
> > won't be an object, and you can't expect to be able to use it at all.

-- ams