An answer reporting a failure: its HTTP status and the API's
errors (D1's own message, such as UNIQUE constraint failed: ...: SQLITE_CONSTRAINT, is the first).
Attributes#
| Attribute | Type | Description |
|---|---|---|
status | = status | |
errors | = tuple(errors) |
Functions#
__init__#
__init__(status, errors) -> None| Parameter | Type | Description |
|---|---|---|
status | int | |
errors | Sequence[D1Message] |
def __init__(self, status: int, errors: Sequence[D1Message]) -> None:
message = errors[0].message if errors else f"D1 request failed with status {status}"
super().__init__(message)
self.status = status
self.errors = tuple(errors)