API errors

Errors hierarchy:

DictionaryApiError
    +-- DictionaryApiNotFoundError

Exceptions

exception freedictionaryapi.errors.DictionaryApiError[source]

Bases: Exception

Common error for all API errors.

code = None
exception freedictionaryapi.errors.DictionaryApiNotFoundError[source]

Bases: freedictionaryapi.errors.DictionaryApiError

API error that raised if response status code is 404 (Not Found).

The most often might occur when searched word is not found.

code = 404

Exceptions mapping

freedictionaryapi.errors.API_ERRORS_MAPPER: Dict[int, Type[freedictionaryapi.errors.DictionaryApiError]] = {404: <class 'freedictionaryapi.errors.DictionaryApiNotFoundError'>}

Mapping of the pairs of response status code and correspond exception type