def _handle_error(self, error_data): if error_data["error"] == "400" and ("data" in error_data): raise exceptions.KazooApiBadDataError(error_data["data"]) raise exceptions.KazooApiError( "There was an error calling the kazoo api, " "Request ID was {1}" "the error was {0}".format( error_data["message"], error_data["request_id"], ))
def _handle_error(self, error_data): if error_data["error"] == "400" and ("data" in error_data): raise exceptions.KazooApiBadDataError(error_data["data"]) if error_data['error'] == '401': raise exceptions.KazooApiAuthenticationError('Invalid credentials') raise exceptions.KazooApiError( "There was an error calling the kazoo api," " Request ID was {1} the error was {0}".format(error_data["message"], error_data["request_id"]) )