"""Custom exceptions."""
from mapchete.errors import MapcheteNodataTile
[docs]
class EmptySliceException(Exception):
"""Raised when slice is empty."""
[docs]
class EmptyProductException(EmptySliceException):
"""Raised when product is empty."""
[docs]
class EmptyStackException(MapcheteNodataTile):
"""Raised when whole stack is empty."""
[docs]
class EmptyFileException(Exception):
"""Raised when no bytes are downloaded."""
[docs]
class IncompleteDownloadException(Exception):
""" "Raised when the file is not downloaded completely."""
[docs]
class InvalidMapcheteEOCollectionError(Exception):
""" "Raised for unsupported collections of Mapchete EO package."""
[docs]
class EmptyCatalogueResponse(Exception):
"""Raised when catalogue response is empty."""
[docs]
class CorruptedGTiffError(Exception):
"""Raised when GTiff validation fails."""
[docs]
class BRDFError(Exception):
"""Raised when BRDF grid cannot be calculated."""
[docs]
class AssetError(Exception):
"""Generic Exception class for Assets."""
[docs]
class AssetMissing(AssetError, FileNotFoundError):
"""Raised when a product asset should be there but isn't."""
[docs]
class AssetEmpty(AssetError):
"""Raised when a product asset should contain data but is empty."""
[docs]
class AssetKeyError(AssetError, KeyError):
"""Raised when an asset name cannot be found in item."""
[docs]
class PreprocessingNotFinished(Exception):
"""Raised when preprocessing tasks have not been fully executed."""
[docs]
class AllMasked(Exception):
"""Raised when an array is fully masked."""
[docs]
class NoSourceProducts(MapcheteNodataTile, ValueError):
"""Raised when no products are available."""
[docs]
class CorruptedProduct(Exception):
"""Raised when product is damaged and cannot be read."""
[docs]
class CorruptedSlice(Exception):
"""Raised when all products in a slice are damaged and cannot be read."""
[docs]
class ItemGeometryError(Exception):
"""Raised when STAC item geometry cannot be resolved."""