final class DBGlobalsException extends Exception { String mistake; //where this is shorthand for chained constructors that look like Exception DBGlobalsException(String message, Throwable cause) { super(message,cause); } // elaborate your exception with whatever error state you want to propagate outwards void setField(mistake) { } } catch (IOException ex) { DBGlobals.Error("OHMjson.Graph.saveLastGraphName - Error: " + ex.getMessage()); msg = "Unable to save data"; status = false; DBGlobalsException dbe = new DBGlobalsException(msg,ex); dbe.setField(status); throw dbe; } This post code is taken from my previous post...
https://stackoverflow.com/users/recent/454848
Please correct me if i am wrong...
- What does the setField method do? Do we need one.
- throw dbe would throw me the expection and the message being appended.
- What does chained construtor mean, is it like having multiple constructors.
setField()specifically, I just included that to point the way towards embedding whatever state/error status in theExceptionthat you need to handle it. Suggest you look at the comments I left on my answer to the earlier question...Exceptionchaining here: download.oracle.com/javase/6/docs/api/java/lang/Throwable.html