"""Exceptions.""" from typing import Any from werkzeug.exceptions import InternalServerError, NotFound class ReleaseNotFound(NotFound): """Exception raised when a release was not found.""" pass class TrackNotFound(NotFound): """Exception raised when a track was not found.""" pass class TrackListingNotFound(InternalServerError): """Exception raised when a track listing for a release was not found.""" pass class ReleaseLookupError(InternalServerError): """Exception raised when an unexpected error occurs retrieving a release.""" name = "internal_error" class TrackLookupError(InternalServerError): """Exception raised when an unexpected error occurs retrieving a track.""" name = "internal_error" class ValidateInternalError(InternalServerError): """Exception raised when validate encounters an internal error.""" def __init__(self, result: dict[str, Any]) -> None: super().__init__() self.result = result class ValidateNotFoundError(NotFound): """Exception raised when validate encounters a not found error.""" def __init__(self, result: dict[str, Any]) -> None: super().__init__() self.result = result