Hi Asankha,

thanks for your reply. Humans life would be to boring, if we would always share 
the same opinion. ;-)

> This basically follows some ideas from Joshua Bloch (Effective Java:
> Programming Language Guide), and some discussions on the use of checked
> exceptions vs runtime exceptions.
Ah, cool. I also read Josh's books and followed a lot of those discussions.


> Item 40:Use checked exceptions for recoverable conditions and run-time
> exceptions for programming errors
I agree with this.

> Item 41:Avoid unnecessary use of checked exceptions
Also agreed, although it is sometimes not that easy to correctly foresee 
whether the caller might be able to recover or not. In case of uncertainty I 
tend to assume the first.

> Item 43: Throw exceptions appropriate to the abstraction
This is very, very important. And at this point I would rather also like to 
add, that one sometimes should also take care to not violate this indirectly 
via chaining the cause which brings along all the details which should be 
abstracted. That's via a favour to create new exceptions at that point a 
properly the details at the abstraction boarder.

> I personally follow logging of an Exception the first time you find out
> about it (i.e. thrown from an external system to you), or you throwing
> an exception - so that most of the context information about the
> exception could be logged for analysis. 
Ok, if you decide that you can handle this exception accordingly, I totally 
agree. But in this case why should you rethrow it? If you can't handle it and 
decide the caller might be able to handle it (not arguing about checked or 
unchecked at this point at all to concentrate on one topic), you can't log the 
error as it might be not a real problem for the caller which may be able to 
compensate. Logging some general context info for later correlation is another 
topic. This way you also avoid logging the same exception a couple of times, as 
the caller can't know whether something has already been logged and from his 
perspective it is the first time he is catching this exception. I don't think 
you use the SynapseException only for wrapping, but also for "self created" 
exceptions, or?

> Most of the cases where a
> SynapseException is thrown are unrecoverable situations - since many are
> dependent on a myriad of causes stemming from AxisFaults.. There are
Hmm, you know the code for sure better, but I know for sure that this is at 
least sometimes not the case.

Anyway it looks like there has already been some discussion about it and I do 
not want to change something about, just make sure I'm not missing a very 
special reason. ;-)

Regards,
  Eric

Reply via email to