diff --git a/python-lib/sharepoint_client.py b/python-lib/sharepoint_client.py index 8959e14..b94c14c 100644 --- a/python-lib/sharepoint_client.py +++ b/python-lib/sharepoint_client.py @@ -773,7 +773,7 @@ def assert_response_ok(self, response, no_json=False, calling_method=""): logger.error("dump={}".format(response.content)) enriched_error_message = self.get_enriched_error_message(response) if enriched_error_message is not None: - raise SharePointClientError("Error ({}): {}".format(calling_method, enriched_error_message)) + raise SharePointClientError("Error {} ({}): {}".format(status_code, calling_method, enriched_error_message)) if status_code == 400: raise SharePointClientError("({}){}".format(calling_method, response.text)) if status_code == 404: @@ -819,7 +819,9 @@ def get_enriched_error_message(response): json_response, [ ["error", "message", "value"], - ["error_description"] + ["error_description"], + ["error","message"], + ["odata.error","message","value"] ] ) if error_message: