axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Whitlock <>
Subject throw in method signatures
Date Wed, 04 May 2005 12:20:20 GMT

Some methods have throw( <list of exceptions> ) in their signature and some
do not. Unlike Java, the compiler allows an exception not in the list to be
thrown from within such a method, but this causes the unexpected() handler
to be driven which causes a coredump. So making a method throw a different
exception, may make a method further up the stack coredump (if it doesn't
have the new exception in its thrown exception list). If some methods have
thrown exception lists in their signature and some do not, this increases
the chances of such coredumps, since the effects of throwing a different
exception will be less obvious (until it fails at runtime).

So I propose that we do not put thrown exception lists in method

Maybe it would be better to put thrown exception lists on *every* method,
if some compiler would give warnings about "method throwing an exception
not in the thrown exception list". But I'm not aware that any compiler
does. Unless anyone knows different?

What do you think?
Mark Whitlock

View raw message