bpod_core.ipc.ErrorData

class bpod_core.ipc.ErrorData

Bases: Struct

A struct representing error data.

static from_exception(exception=None) ErrorData

Serialize an exception to ErrorData.

Parameters:

exception (BaseException, optional) – The exception to serialize.

Returns:

An ErrorData struct containing the serialized exception data.

Return type:

ErrorData

Raises:

ValueError – If no exception is provided and no active exception is available.

args: tuple

The arguments passed to the exception.

message: str

The error message.

name: str

The name of the exception class.

traceback: str | None

The formatted traceback of the exception.