Exceptional ... exception management

From AWiki

Jump to: navigation, search


Real case of never-tested production code that ever throws NullPointerException during exception management: in application log the original exception is masked by the NullPointerException raised by management code.

MyClass result = null;
try {
	result = callMethod(...);
} catch(Exception e) {
 	result.registerException(e); // throws ever NullPointerException
}
Personal tools