Ok i have sinned, i wrote too much code like this
try {
// my code
} catch (Exception ex) {
// doesn't matter
}
Now i’m going to cleanup/refactor this.
I’m using NB 6.7 and code completion works fine on first writing, adding all Exception types, etc. Once i have done the above code NB do not give more help.
Do you know a way to say NB look again for all Exception types and make the proposal for handling them and do code completion again ?
There is no generally accepted way to handle them. Otherwise, you bet the java language would have implicitly that behavior.
Exceptions exist in two forms, by design:
At each level of code (method or block), the code has to choose what to do, in the event of any exception (except unchecked exceptions that can omit the treatment altogether). This is a choice of responsibility that varies, there is no decision valid for all cases :
The java language lets you have specific syntaxes making easier to handle exceptions, like the catch of specific exceptions followed more general ones…
Typically, you consider Exceptions in your architecture, and make some design decisions. Some examples (mixed in unique ways):