Am 28.09.2015 05:20, schrieb Edinson E. Padrón Urdaneta:
|This way we could write the following list of 'constructs':
|
|
- try-catch-else-finally|
|- try-catch|-else
|- try-else-finally|
||- try-else (I'm not so sure about this one, it could be in conflict
with java(?))
|
|
This will improves the readability of exception handling in some
situations. What do you guys think about it?

what types of exceptions would be catched in the else block? if it is Exception and subclasses, we have already something. Example:

try  {
  foo()
} catch (SomeException se) {
// handle SomeException
} catch (e) {
// handle exception which is not a SomeException
}

going to Throwable or Error can be problematic. And the short version of the catch here also easily allows to still handle the exception itself. Does this do what you want?

bye blackdrag

--
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/

Reply via email to