Source code for ecstask.osp_eventhandler_v2.exceptions.pick_task_handler_exception

[docs]class PickTaskHandlerException(Exception): """Base class to handle exceptions with the PickTaskCompleteBigQueryHandler class"""
[docs]class PayloadValidationException(Exception): """Base class to handle payload validation exceptions"""
[docs]class PayloadValidationError(PayloadValidationException): """Exception raised when there is an error while validating fields from the payload Attributes: message (String): explanation of the error """
[docs] def __init__(self, message='An error occurred while validating request payload, ' 'this is probably due to one of the required field misisng from the request, ' 'See logs for more details'): self.message = message
[docs]class RequestFormatError(PickTaskHandlerException): """Exception raised when the request from the webhook is missing one or more properties Attributes: message (String): explanation of the error """
[docs] def __init__(self, message='The request received from the web hook is missing one or more properties double' 'check what you are posting', field=None): if field: self.message = f'The request received from the web hook is missing {field}' else: self.message = message