focusnet / focus-app-android

FOCUS Mobile
http://www.focusnet.eu
MIT License
0 stars 0 forks source link

Do not capture RunTimeException with FocusInternalErrorException #21

Closed jlnknz closed 8 years ago

jlnknz commented 8 years ago

For example we sometimes do

try {
...
}
        catch (IOException ex) {
            throw new FocusInternalErrorException(msg or ex);
        }

Catch them directly from the caller. It gives us more control on error reporting.

jlnknz commented 8 years ago

When we do indeed capture RunTimeException with FocusInternalErrorException, we keep the exception as is and pass it to the new FocusInternalErrorException constructor.

These cases denote that the program cannot continue as-is because something mandatory is missing, and we then crash. We then transform a checked exception into our non-checked FocusInternalErrorException exception.

We never catch FocusInternalErrorException for doing error handling and remediation.