コンテンツにスキップ

エラー

このライブラリが送出する例外はすべて BitflyerError を継承しているため、 except BitflyerError 一つですべて捕捉できます。httpx のトランスポート例外はラップされず、 そのまま伝播します。

BitflyerError

Bases: Exception

Base class for every error raised by this library.

CredentialsError

Bases: BitflyerError

A Private API call was attempted without an API key and secret.

APIError

APIError(
    message: str,
    *,
    status_code: int,
    status: int | None = None,
    error_message: str | None = None,
    data: Any = None,
    body: str = "",
    request: Request | None = None,
    response: Response | None = None,
)

Bases: BitflyerError

The bitFlyer API returned an error response.

Attributes:

Name Type Description
status_code

HTTP status code of the response.

status

bitFlyer's numeric error code, or None if the body was not a bitFlyer error object.

error_message

bitFlyer's human-readable message, or None.

data

The data field of the error body, or None.

body

The raw response body, decoded as text.

request

The request that produced the error.

response

The error response.

RateLimitError

RateLimitError(
    *args: Any,
    retry_after: float | None = None,
    **kwargs: Any,
)

Bases: APIError

The request was rejected because a rate limit was exceeded.

Attributes:

Name Type Description
retry_after

Seconds to wait before retrying, parsed from the Retry-After header, or None if the header was absent.

RealtimeError

Bases: BitflyerError

The Realtime (WebSocket) API returned an error or the connection failed.