Source code for pyworldatlas.exceptions

"""Public exception hierarchy for PyWorldAtlas."""


[docs] class AtlasError(Exception): """Base class for atlas errors."""
[docs] class AtlasClosedError(AtlasError): """Raised when a closed atlas is used."""
[docs] class DatasetError(AtlasError): """Base class for bundled-dataset errors."""
[docs] class DatasetNotFoundError(DatasetError): """Raised when the bundled SQLite database cannot be found."""
[docs] class DatasetVersionError(DatasetError): """Raised when runtime and dataset schema versions disagree."""
[docs] class DatasetIntegrityError(DatasetError): """Raised when the bundled dataset fails an integrity check."""
[docs] class CountryNotFoundError(AtlasError, LookupError): """Raised when a country query has no match."""
[docs] class AmbiguousCountryError(AtlasError, LookupError): """Raised when a country query has multiple equally valid matches."""
[docs] class PlaceNotFoundError(AtlasError, LookupError): """Raised when a place query has no match."""
[docs] class AmbiguousPlaceError(AtlasError, LookupError): """Raised when a place query is ambiguous."""
[docs] class CapitalNotFoundError(PlaceNotFoundError): """Raised when a capital query has no match."""
[docs] class MapSupportNotInstalledError(AtlasError): """Raised when an optional map viewer or map-data pack is unavailable."""