From 92b94b59ad80329a2c99471edbf5bbdc9af1e525 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 26 Jun 2020 12:17:26 +0200 Subject: Revamp error responses --- opendc/util/exceptions.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'opendc/util/exceptions.py') diff --git a/opendc/util/exceptions.py b/opendc/util/exceptions.py index caf6dd8e..e73dad4f 100644 --- a/opendc/util/exceptions.py +++ b/opendc/util/exceptions.py @@ -55,3 +55,11 @@ class MissingParameterError(ParameterError): self.parameter_name = parameter_name self.parameter_location = parameter_location + + +class ClientRequestError(Exception): + """Raised when a 4xx response is to be returned.""" + + def __init__(self, response): + super(ClientRequestError, self).__init__(str(response)) + self.response = response -- cgit v1.2.3