|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--DryRotException
Class to implement DRYROT messages for MAExplorer. DRYROT messages are fatal errors that indicates either that something is wrong with the program, bad or corrupted data structures etc. Since you can not continue, it passes the information to a Dryrot report method that pops up a Dialog box for the user and suggests they mail the code author with the saved error message and MAExplorer state.
At the point in a method when you want to throw a DryRotException, use the syntax "throw new DryRotException(msg);" and specify in the parameter a String of useful information.
Any method that contains a throw must have a try block to catch this exception or "Exception" itself or throw the exception to the next method.
Thus for DryRotException,
class Example { public void myMethod () throws DryRotException { throw new DryRotException("Line 22 of Foo class had a bad var"); } public static void main (String [] args) { try { Example o = new Example(); o.myMethod(); } catch (DryRotException e) { System.out.print("Exception: "+e); } } }[JE Created on December 19, 2001, 2:15 PM, Version 1.0]
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.
Fields inherited from class java.lang.Throwable |
backtrace, detailMessage, serialVersionUID |
Constructor Summary | |
DryRotException()
DryRotException() - constructor to create new DryRotException without
detail message. |
|
DryRotException(java.lang.String msg)
Constructs an DryRotException with the specified detail message. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, printStackTrace0, toString |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public DryRotException()
DryRotException
without
detail message.public DryRotException(java.lang.String msg)
DryRotException
with the specified detail message.msg
- the detail message.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |