exceptions

The exceptions for the library.

All the exceptions are accessible through the package root namespace.

All of the exceptions are subclasses of FilingsAPIError or FilingsAPIWarning. This includes APIError.

Exception APIError is defined separately in module api_error due to also being a subclass of APIObject.

Exceptions

FilingsAPIError

Base class for exceptions in this library.

FilingsAPIWarning

Base class for warnings in this library.

CorruptDownloadError

SHA-256 checksum does not match expected value from API.

DatabaseSchemaUnmatchError

The file contains a database whose schema is non-conformant.

HTTPStatusError

No APIError but the HTTP status is not 200.

JSONAPIFormatError

The API returns a JSON:API document in bad format.

FilterNotSupportedWarning

Used filter is not supported but can be used.

exception xbrl_filings_api.exceptions.FilingsAPIError

Bases: Exception

Base class for exceptions in this library.

Not to be confused with APIError which is a subclass of this class representing an error returned by JSON:API.

__str__()

Return “[<msg>] [list of <attr>=<value>]”.

Placeholder attr refers to any own attribute of the exception instance except msg or body. Placeholder value is always in repr() format. The attribute body, has a different display form: len(body)=<len>.

Return type:

str

exception xbrl_filings_api.exceptions.FilingsAPIWarning

Bases: UserWarning

Base class for warnings in this library.

exception xbrl_filings_api.exceptions.CorruptDownloadError

Bases: FilingsAPIError

SHA-256 checksum does not match expected value from API.

See also

downloader.CorruptDownloadError

Not FilingsAPIError subclassed.

path: str

Path where the file was saved.

url: str

URL where the file was downloaded from.

calculated_hash: str

Actual SHA-256 checksum of the file in lowercase hex.

expected_hash: str

Expected SHA-256 checksum of the file in lowercase hex.

Originates from Filing attribute package_sha256.

exception xbrl_filings_api.exceptions.DatabaseSchemaUnmatchError

Bases: FilingsAPIError

The file contains a database whose schema is non-conformant.

Either none of the expected tables are present or none of the expected columns for a matching table.

path: str

Path for the database file.

exception xbrl_filings_api.exceptions.HTTPStatusError

Bases: FilingsAPIError

No APIError but the HTTP status is not 200.

status_code: int

HTTP status code.

status_text: str

Description of the HTTP status.

body: str

Body text of the response.

exception xbrl_filings_api.exceptions.JSONAPIFormatError

Bases: FilingsAPIError

The API returns a JSON:API document in bad format.

msg: str

Error message.

exception xbrl_filings_api.exceptions.FilterNotSupportedWarning

Bases: FilingsAPIWarning

Used filter is not supported but can be used.