|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.python.core.PyException
public class PyException
A wrapper for all python exception. Note that the wellknown python exception are not
subclasses of PyException. Instead the python exception class is stored in the type
field and value or class instance is stored in the value field.
| Field Summary | |
|---|---|
PyTraceback |
traceback
The exception traceback object. |
PyObject |
type
The python exception class (for class exception) or identifier (for string exception). |
PyObject |
value
The exception instance (for class exception) or exception value (for string exception). |
| Constructor Summary | |
|---|---|
PyException()
|
|
PyException(PyObject type)
|
|
PyException(PyObject type,
PyObject value)
|
|
PyException(PyObject type,
PyObject value,
PyTraceback traceback)
|
|
PyException(PyObject type,
java.lang.String value)
|
|
| Method Summary | |
|---|---|
static PyException |
doRaise(PyObject type,
PyObject value,
PyObject traceback)
Logic for the raise statement |
static java.lang.String |
exceptionClassName(PyObject obj)
Get the name of the exception's class |
java.lang.Throwable |
fillInStackTrace()
|
static boolean |
isExceptionClass(PyObject obj)
Determine whether obj is a Python exception class |
static boolean |
isExceptionInstance(PyObject obj)
Determine whether obj is an Python exception instance |
void |
normalize()
Instantiates the exception value if it is not already an instance. |
void |
printStackTrace()
|
void |
printStackTrace(java.io.PrintStream s)
|
void |
super__printStackTrace(java.io.PrintWriter w)
|
java.lang.String |
toString()
|
void |
tracebackHere(PyFrame here)
Register frame as having been visited in the traceback. |
void |
tracebackHere(PyFrame here,
boolean isFinally)
Register frame as having been visited in the traceback. |
| Methods inherited from class java.lang.Throwable |
|---|
getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public PyObject type
public PyObject value
public PyTraceback traceback
| Constructor Detail |
|---|
public PyException()
public PyException(PyObject type)
public PyException(PyObject type,
PyObject value)
public PyException(PyObject type,
PyObject value,
PyTraceback traceback)
public PyException(PyObject type,
java.lang.String value)
| Method Detail |
|---|
public void printStackTrace()
printStackTrace in class java.lang.Throwablepublic java.lang.Throwable fillInStackTrace()
fillInStackTrace in class java.lang.Throwablepublic void printStackTrace(java.io.PrintStream s)
printStackTrace in class java.lang.Throwablepublic void super__printStackTrace(java.io.PrintWriter w)
public java.lang.String toString()
toString in class java.lang.Throwablepublic void normalize()
public void tracebackHere(PyFrame here)
here - the current PyFrame
public void tracebackHere(PyFrame here,
boolean isFinally)
here - the current PyFrameisFinally - whether caller is a Python finally block
public static PyException doRaise(PyObject type,
PyObject value,
PyObject traceback)
type - the first arg to raise, a type or an instancevalue - the second arg, the instance of the class or
arguments to its constructortb - a traceback object
public static boolean isExceptionClass(PyObject obj)
obj - a PyObject
public static boolean isExceptionInstance(PyObject obj)
obj - a PyObject
public static java.lang.String exceptionClassName(PyObject obj)
obj - a PyObject exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||