help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: caught non-std exception


From: Ulrich Eckhardt
Subject: Re: caught non-std exception
Date: Sun, 19 Mar 2006 12:31:08 +0100
User-agent: KNode/0.9.3

Mike - EMAIL IGNORED wrote:
> On FC4 with g++ using STL 

The STL is pretty dead, are you really using it or do you mean the C++
standardlibrary? Also, which version of g++ are you talking about? Some
people might also not know what FC means (fibre channel?). ;)

> and Posix threads 

POSIX, its an abbreviation.

> and sockets I am catching an exception  
> that is not a std::exception.  Any idea what it might be?

An uncaught exception calls abort() which usually invokes the debugger, so
it should be possible to find out. Also, if you don't want to catch it
just don't catch it.

> An outline of my catch macro is below.
> #define MY_MACRO \
>    catch (MyExceptions& e) \
>    { \
>        ...  \\ process them \
>    } \
>    catch (std::exception& e) \
>    { \
>        ...  \\ process them \
>    } \
>    catch (...) \
>    { \
>        ...  \\ what is this \
>    }

- Macros are evil. 
- Don't catch exceptions unless you handle them, as a general advise.
- You can catch const references. 
- When catching '...', the only sensible thing to do is to abort/exit or to
rethrow.
- This looks like a general C++ problem that has nothing to do with g++.

cheers

Uli

-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]