C# Класс Python.Runtime.Exceptions

Encapsulates the Python exception APIs.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ArithmeticError System.IntPtr
AssertionError System.IntPtr
AttributeError System.IntPtr
BaseException System.IntPtr
DeprecationWarning System.IntPtr
EOFError System.IntPtr
EnvironmentError System.IntPtr
Exception System.IntPtr
FloatingPointError System.IntPtr
FutureWarning System.IntPtr
GeneratorExit System.IntPtr
IOError System.IntPtr
ImportError System.IntPtr
ImportWarning System.IntPtr
IndentationError System.IntPtr
IndexError System.IntPtr
KeyError System.IntPtr
KeyboardInterrupt System.IntPtr
LookupError System.IntPtr
MemoryError System.IntPtr
NameError System.IntPtr
NotImplementedError System.IntPtr
OSError System.IntPtr
OverflowError System.IntPtr
PendingDeprecationWarning System.IntPtr
ReferenceError System.IntPtr
RuntimeError System.IntPtr
RuntimeWarning System.IntPtr
StandardError System.IntPtr
StopIteration System.IntPtr
SyntaxError IntPtr
SyntaxWarning IntPtr
SystemError IntPtr
SystemExit IntPtr
TabError IntPtr
TypeError IntPtr
UnboundLocalError IntPtr
UnicodeDecodeError IntPtr
UnicodeEncodeError IntPtr
UnicodeError IntPtr
UnicodeTranslateError IntPtr
UnicodeWarning IntPtr
UserWarning IntPtr
ValueError IntPtr
Warning IntPtr
ZeroDivisionError IntPtr

Открытые методы

Метод Описание
Clear ( ) : void

Clear Method

Clear any exception that has been set in the Python runtime.

ErrorOccurred ( ) : bool

ErrorOccurred Method

Returns true if an exception occurred in the Python runtime. This is a wrapper for the Python PyErr_Occurred call.

ExceptionMatches ( IntPtr ob ) : bool

ExceptionMatches Method

Returns true if the current Python exception matches the given Python object. This is a wrapper for PyErr_ExceptionMatches.

ExceptionMatches ( IntPtr exc, IntPtr ob ) : bool

ExceptionMatches Method

Returns true if the given Python exception matches the given Python object. This is a wrapper for PyErr_GivenExceptionMatches.

SetError ( Exception e ) : void

SetError Method

Sets the current Python exception given a CLR exception object. The CLR exception instance is wrapped as a Python object, allowing it to be handled naturally from Python.

SetError ( IntPtr ob, IntPtr value ) : void

SetError Method

Sets the current Python exception given a Python object. This is a wrapper for the Python PyErr_SetObject call.

SetError ( IntPtr ob, string value ) : void

SetError Method

Sets the current Python exception given a native string. This is a wrapper for the Python PyErr_SetString call.

deprecation ( string message ) : void
deprecation ( string message, int stacklevel ) : void
warn ( string message, IntPtr exception ) : void
warn ( string message, IntPtr exception, int stacklevel ) : void

Alias for Python's warnings.warn() function.

Приватные методы

Метод Описание
ErrorCheck ( IntPtr pointer ) : void

Shortcut for (pointer == NULL) -> throw PythonException

ErrorOccurredCheck ( IntPtr pointer ) : void

Shortcut for (pointer == NULL or ErrorOccurred()) -> throw PythonException

Exceptions ( ) : System
Initialize ( ) : void
RaiseTypeError ( string message ) : IntPtr
SetArgsAndCause ( IntPtr ob ) : void

Set the 'args' slot on a python exception object that wraps a CLR exception. This is needed for pickling CLR exceptions as BaseException_reduce will only check the slots, bypassing the __getattr__ implementation, and thus dereferencing a NULL pointer.

Shutdown ( ) : void

Описание методов

Clear() публичный статический Метод

Clear Method
Clear any exception that has been set in the Python runtime.
public static Clear ( ) : void
Результат void

ErrorOccurred() публичный статический Метод

ErrorOccurred Method
Returns true if an exception occurred in the Python runtime. This is a wrapper for the Python PyErr_Occurred call.
public static ErrorOccurred ( ) : bool
Результат bool

ExceptionMatches() публичный статический Метод

ExceptionMatches Method
Returns true if the current Python exception matches the given Python object. This is a wrapper for PyErr_ExceptionMatches.
public static ExceptionMatches ( IntPtr ob ) : bool
ob System.IntPtr
Результат bool

ExceptionMatches() публичный статический Метод

ExceptionMatches Method
Returns true if the given Python exception matches the given Python object. This is a wrapper for PyErr_GivenExceptionMatches.
public static ExceptionMatches ( IntPtr exc, IntPtr ob ) : bool
exc System.IntPtr
ob System.IntPtr
Результат bool

SetError() публичный статический Метод

SetError Method
Sets the current Python exception given a CLR exception object. The CLR exception instance is wrapped as a Python object, allowing it to be handled naturally from Python.
public static SetError ( Exception e ) : void
e System.Exception
Результат void

SetError() публичный статический Метод

SetError Method
Sets the current Python exception given a Python object. This is a wrapper for the Python PyErr_SetObject call.
public static SetError ( IntPtr ob, IntPtr value ) : void
ob System.IntPtr
value System.IntPtr
Результат void

SetError() публичный статический Метод

SetError Method
Sets the current Python exception given a native string. This is a wrapper for the Python PyErr_SetString call.
public static SetError ( IntPtr ob, string value ) : void
ob System.IntPtr
value string
Результат void

deprecation() публичный статический Метод

public static deprecation ( string message ) : void
message string
Результат void

deprecation() публичный статический Метод

public static deprecation ( string message, int stacklevel ) : void
message string
stacklevel int
Результат void

warn() публичный статический Метод

public static warn ( string message, IntPtr exception ) : void
message string
exception IntPtr
Результат void

warn() публичный статический Метод

Alias for Python's warnings.warn() function.
public static warn ( string message, IntPtr exception, int stacklevel ) : void
message string
exception IntPtr
stacklevel int
Результат void

Описание свойств

ArithmeticError публичное статическое свойство

public static IntPtr,System ArithmeticError
Результат System.IntPtr

AssertionError публичное статическое свойство

public static IntPtr,System AssertionError
Результат System.IntPtr

AttributeError публичное статическое свойство

public static IntPtr,System AttributeError
Результат System.IntPtr

BaseException публичное статическое свойство

public static IntPtr,System BaseException
Результат System.IntPtr

DeprecationWarning публичное статическое свойство

public static IntPtr,System DeprecationWarning
Результат System.IntPtr

EOFError публичное статическое свойство

public static IntPtr,System EOFError
Результат System.IntPtr

EnvironmentError публичное статическое свойство

public static IntPtr,System EnvironmentError
Результат System.IntPtr

Exception публичное статическое свойство

public static IntPtr,System Exception
Результат System.IntPtr

FloatingPointError публичное статическое свойство

public static IntPtr,System FloatingPointError
Результат System.IntPtr

FutureWarning публичное статическое свойство

public static IntPtr,System FutureWarning
Результат System.IntPtr

GeneratorExit публичное статическое свойство

public static IntPtr,System GeneratorExit
Результат System.IntPtr

IOError публичное статическое свойство

public static IntPtr,System IOError
Результат System.IntPtr

ImportError публичное статическое свойство

public static IntPtr,System ImportError
Результат System.IntPtr

ImportWarning публичное статическое свойство

public static IntPtr,System ImportWarning
Результат System.IntPtr

IndentationError публичное статическое свойство

public static IntPtr,System IndentationError
Результат System.IntPtr

IndexError публичное статическое свойство

public static IntPtr,System IndexError
Результат System.IntPtr

KeyError публичное статическое свойство

public static IntPtr,System KeyError
Результат System.IntPtr

KeyboardInterrupt публичное статическое свойство

public static IntPtr,System KeyboardInterrupt
Результат System.IntPtr

LookupError публичное статическое свойство

public static IntPtr,System LookupError
Результат System.IntPtr

MemoryError публичное статическое свойство

public static IntPtr,System MemoryError
Результат System.IntPtr

NameError публичное статическое свойство

public static IntPtr,System NameError
Результат System.IntPtr

NotImplementedError публичное статическое свойство

public static IntPtr,System NotImplementedError
Результат System.IntPtr

OSError публичное статическое свойство

public static IntPtr,System OSError
Результат System.IntPtr

OverflowError публичное статическое свойство

public static IntPtr,System OverflowError
Результат System.IntPtr

PendingDeprecationWarning публичное статическое свойство

public static IntPtr,System PendingDeprecationWarning
Результат System.IntPtr

ReferenceError публичное статическое свойство

public static IntPtr,System ReferenceError
Результат System.IntPtr

RuntimeError публичное статическое свойство

public static IntPtr,System RuntimeError
Результат System.IntPtr

RuntimeWarning публичное статическое свойство

public static IntPtr,System RuntimeWarning
Результат System.IntPtr

StandardError публичное статическое свойство

public static IntPtr,System StandardError
Результат System.IntPtr

StopIteration публичное статическое свойство

public static IntPtr,System StopIteration
Результат System.IntPtr

SyntaxError публичное статическое свойство

public static IntPtr SyntaxError
Результат IntPtr

SyntaxWarning публичное статическое свойство

public static IntPtr SyntaxWarning
Результат IntPtr

SystemError публичное статическое свойство

public static IntPtr SystemError
Результат IntPtr

SystemExit публичное статическое свойство

public static IntPtr SystemExit
Результат IntPtr

TabError публичное статическое свойство

public static IntPtr TabError
Результат IntPtr

TypeError публичное статическое свойство

public static IntPtr TypeError
Результат IntPtr

UnboundLocalError публичное статическое свойство

public static IntPtr UnboundLocalError
Результат IntPtr

UnicodeDecodeError публичное статическое свойство

public static IntPtr UnicodeDecodeError
Результат IntPtr

UnicodeEncodeError публичное статическое свойство

public static IntPtr UnicodeEncodeError
Результат IntPtr

UnicodeError публичное статическое свойство

public static IntPtr UnicodeError
Результат IntPtr

UnicodeTranslateError публичное статическое свойство

public static IntPtr UnicodeTranslateError
Результат IntPtr

UnicodeWarning публичное статическое свойство

public static IntPtr UnicodeWarning
Результат IntPtr

UserWarning публичное статическое свойство

public static IntPtr UserWarning
Результат IntPtr

ValueError публичное статическое свойство

public static IntPtr ValueError
Результат IntPtr

Warning публичное статическое свойство

public static IntPtr Warning
Результат IntPtr

ZeroDivisionError публичное статическое свойство

public static IntPtr ZeroDivisionError
Результат IntPtr