Exceptions API Reference
This module covers the error hierarchies and exception classes raised by libscid.
LibScidError
libscid.LibScidError
Bases: RuntimeError
Exception raised when an underlying libscid C ABI operation fails.
Encapsulates the name of the failing C function, the numeric scid_error
status code, and any diagnostic message emitted by the native subsystem.
Attributes:
| Name | Type | Description |
|---|---|---|
function |
The name of the C API function that reported the failure
(e.g. |
|
code |
The numeric |
|
diagnostic |
Optional supplementary diagnostic information or parser error details provided by the native library. |
Examples:
>>> import libscid
>>> try:
... libscid.Position.from_fen("invalid fen string")
... except libscid.LibScidError as exc:
... exc.function
... exc.code
'scid_position_create_from_fen'
301
Initialises a new LibScidError instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
function
|
str
|
Name of the failing C API function. |
required |
code
|
int
|
Numeric error status code returned by the C ABI. |
required |
diagnostic
|
str | None
|
Optional diagnostic detail string. |
None
|