IExceptionInterpreter
QuantConnect.Exceptions.IExceptionInterpreter
Defines an exception interpreter. Interpretations are invoked on IAlgorithm.RunTimeError
order
order: int
Determines the order that a class that implements this interface should be called
can_interpret
can_interpret(exception: Exception) -> bool
Determines if this interpreter should be applied to the specified exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exception
|
Exception
|
The exception to check |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the exception can be interpreted, false otherwise. |
interpret
interpret(
exception: Exception,
inner_interpreter: IExceptionInterpreter,
) -> Exception
Interprets the specified exception into a new exception
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exception
|
Exception
|
The exception to be interpreted |
required |
inner_interpreter
|
IExceptionInterpreter
|
An interpreter that should be applied to the inner exception. This provides a link back allowing the inner exceptions to be interpreted using the interpreters configured in the IExceptionInterpreter. Individual implementations may ignore this value if required. |
required |
Returns:
| Type | Description |
|---|---|
Exception
|
The interpreted exception. |