From 1d366b043b950eeb31a47ff68314a3098dd56871 Mon Sep 17 00:00:00 2001 From: Marcin Warzybok Date: Mon, 26 Feb 2024 14:02:52 +0100 Subject: [PATCH] SP-874 Support "errors" array - format --- src/bitpay/clients/response_parser.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bitpay/clients/response_parser.py b/src/bitpay/clients/response_parser.py index 73a536d..0352375 100644 --- a/src/bitpay/clients/response_parser.py +++ b/src/bitpay/clients/response_parser.py @@ -40,10 +40,10 @@ def response_to_json_string(response: Response) -> Any: if "errors" in response_obj: final_message = "" for error in response_obj["errors"]: - error_value = error.get('error', '') - param_value = error.get('param', '') + error_value = error.get("error", "") + param_value = error.get("param", "") - if error_value.endswith('.'): + if error_value.endswith("."): error_value = error_value[:-1] if error_value: @@ -51,8 +51,8 @@ def response_to_json_string(response: Response) -> Any: else: result = param_value.strip() - if not result.endswith('.'): - result += '.' + if not result.endswith("."): + result += "." if not final_message == "": result = " " + result