class WorkTimeExceeded(Exception): """Exception class for case when job has taken more time then expected.""" class PlaylistUpdateError(Exception): """Exception class for case when job successfully finished, but some exceptions were detected and skipped during the process. """ class DspApiError(Exception): """Base class for exceptions raised when communicating with dsp.""" pass class DspUnauthorized(DspApiError): """Raised if request to DSP API service failed with authorization error. This exception can mean that dsp api key is missing or credentials are wrong. """ pass class DspUnavailable(DspApiError): """Raised if connection to Dsp API service cannot be established or timeout exceeded.""" pass class DspInvalidResponse(DspApiError): """Raised if Dsp API service returned response which is not handled by job.""" status_code = None message = None response_data = None def __init__(self, message="Delphi invalid response", status_code=None, response_data=None): self.status_code = status_code self.message = message self.response_data = response_data