|
|||||||||
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,
String value)
|
Method Summary | |
---|---|
static PyException |
doRaise(PyObject type,
PyObject value,
PyObject traceback)
Logic for the raise statement |
static String |
exceptionClassName(PyObject obj)
Get the name of the exception's class |
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 |
boolean |
match(PyObject exc)
Determine if this PyException is a match for exc. |
void |
normalize()
Instantiates the exception value if it is not already an instance. |
void |
printStackTrace()
|
void |
printStackTrace(PrintStream s)
|
void |
super__printStackTrace(PrintWriter w)
|
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, String value)
Method Detail |
---|
public void printStackTrace()
printStackTrace
in class Throwable
public Throwable fillInStackTrace()
fillInStackTrace
in class Throwable
public void printStackTrace(PrintStream s)
printStackTrace
in class Throwable
public void super__printStackTrace(PrintWriter w)
public String toString()
toString
in class Throwable
public void normalize()
public void tracebackHere(PyFrame here)
here
- the current PyFramepublic void tracebackHere(PyFrame here, boolean isFinally)
here
- the current PyFrameisFinally
- whether caller is a Python finally blockpublic 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
constructortraceback
- a traceback object
public boolean match(PyObject exc)
exc
- a PyObject exception type
public static boolean isExceptionClass(PyObject obj)
obj
- a PyObject
public static boolean isExceptionInstance(PyObject obj)
obj
- a PyObject
public static String exceptionClassName(PyObject obj)
obj
- a PyObject exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |