|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
tcl.lang.TclException
public class TclException
TclException is used to interrupt the Tcl script currently being interpreted by the Tcl Interpreter. Usually, a TclException is thrown to indicate a script level error, e.g.: - A syntax error occurred in a script. - A unknown variable is referenced. - A unknown command is executed. - A command is passed incorrected. A TclException can also be thrown by Tcl control structure commands such as "return" and "continue" to change the flow of control in a Tcl script. A TclException is accompanied by two pieces of information: the error message and the completion code. The error message is a string stored in the interpreter result. After a TclException is thrown and caught, the error message can be queried by Interp.getResult(). The completion code indicates why the TclException is generated. It is stored in the compCode field of this class.
Field Summary | |
---|---|
int |
errIndex
An index that indicates where an error occurs inside a Tcl string. |
Constructor Summary | |
---|---|
|
TclException(int ccode)
Create a TclException with the given completion code. |
|
TclException(Interp interp,
String msg)
Create an TclException with the given error message. |
|
TclException(Interp interp,
String msg,
int ccode)
Create an TclException with the given error message and completion code. |
protected |
TclException(Interp interp,
String msg,
int ccode,
int idx)
Create an TclException with the given error message and completion code and indicate the location of the error in a script. |
Method Summary | |
---|---|
int |
getCompletionCode()
getCompletionCode -- |
void |
setCompletionCode(int ccode)
Sets the current completion code. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int errIndex
Constructor Detail |
---|
protected TclException(Interp interp, String msg, int ccode, int idx)
interp
- current interpreter; may be nullmsg
- error messageccode
- completion code (TCL.ERROR, TCL.BREAK, etc)idx
- error indexpublic TclException(int ccode)
ccode
- completion codepublic TclException(Interp interp, String msg)
interp
- current interpreter, may be null if unknownmsg
- error messagepublic TclException(Interp interp, String msg, int ccode)
interp
- current interpreter, may be null if unknownmsg
- error messageccode
- completion codeMethod Detail |
---|
public final int getCompletionCode()
public final void setCompletionCode(int ccode)
ccode
- new completion code
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |