Originally posted by Jaun Katabasis:
in my design each subsystem throwed just exceptions congruent with its level. as example
my (layered) database subsystem throwed
database exceptions at a medium level, while my client facade just throwed client exceptions in an upper level. for this purpose i extensively used translations & exception chaining.
quoted by Mark Spritzler :
Say I get a DatabaseException which has a reference to a ServerException, which has a reference to a RemoteException, which has a reference to a InvalidNumberException. You class has the DatabaseException and way to travers all the way down to the InvalidNumberException and see what is inside it.
the class that finally manages the exception will have to deal with different kind of exceptions, from different levels. a chaotic design imo.
while wrapping at each level is it possible to supply Diagnostic Information in the message ?
How does the application know that this is the level where the source of the problem lies in order to supply Diagnostic Information in the message?