From e8e4f52a16abfc51496ddd3b237597b9e106c19a Mon Sep 17 00:00:00 2001 From: "Shon T. Urbas" Date: Wed, 6 Dec 2017 14:25:16 -0500 Subject: [PATCH] A decoder error is a ValueError allows us to catch all decode errors from requests without force install simplejson --- keycloak/exceptions.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keycloak/exceptions.py b/keycloak/exceptions.py index aeef7c2..3b0b147 100644 --- a/keycloak/exceptions.py +++ b/keycloak/exceptions.py @@ -22,7 +22,6 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import requests -from simplejson import JSONDecodeError class KeycloakError(Exception): @@ -82,7 +81,7 @@ def raise_error_from_response(response, error, expected_code=200, skip_exists=Fa try: return response.json() - except JSONDecodeError as e: + except ValueError: return response.content if skip_exists and response.status_code == 409: