reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Weimer <mar...@weimo.de>
Subject Re: REEF error propagation standard
Date Mon, 05 Jun 2017 17:57:21 GMT
In Java, we have agreed upon a few rules, some of which are codified
in our checkstyle tests. IIRC, they are:

  * We do not allow empty `catch` blocks
  * When throwing an exception from a `catch` block, add the causing exception.
  * Do not log exceptions in a `catch` block unless you handle them.
  * Do not log exceptions where you throw them.

The latter two rules make sure that we, in theory, log every
exceptions exactly once: Either at the place where it is handled or by
the JVM when that exception crashes the JVM.

Markus

On Sun, Jun 4, 2017 at 7:11 AM, Saikat Kanjilal <sxk1969@gmail.com> wrote:
> How about this?
>
> http://javarevisited.blogspot.com/2013/03/0-exception-handling-best-practices-in-Java-Programming.html?m=1
>
> Hope it helps.
>
> Sent from my iPhone
>
>> On Jun 4, 2017, at 6:01 AM, Byung-Gon Chun <bgchun@gmail.com> wrote:
>>
>> A good guideline on Java programming is Effective Java (2nd ed.).
>> Do we have a similar book related to .NET (say Effective .NET)?
>>
>> -Gon
>>
>>> On Sun, Jun 4, 2017 at 9:33 PM, Byung-Gon Chun <bgchun@gmail.com> wrote:
>>>
>>> Hi Doug,
>>>
>>> I don't think we have *formal* exception handling rules.
>>> The following stack overflow page shows a set of good rules.
>>> https://stackoverflow.com/questions/3551221/guidelines-
>>> on-exception-propagation-in-java
>>>
>>> Thanks!
>>> -Gon
>>>
>>> On Sun, Jun 4, 2017 at 12:40 PM, Douglas Service <dsopsrc@gmail.com>
>>> wrote:
>>>
>>>> Is there any documentation on error handling standards in REEF? For
>>>> example
>>>> when should one throw and exception and when should one log the error? I
>>>> have put out a pull request for REEF-1763, but I think error handling may
>>>> need to be addressed to make it more consistent with current REEF
>>>> standards.
>>>>
>>>> Doug
>>>>
>>>
>>>
>>>
>>> --
>>> Byung-Gon Chun
>>>
>>
>>
>>
>> --
>> Byung-Gon Chun

Mime
View raw message