From 6e21892a0bade9c1b84038f8c3177140d29cfc5a Mon Sep 17 00:00:00 2001 From: Qian Sun Date: Fri, 24 Sep 2021 04:37:24 +0000 Subject: [PATCH] Don't drop details info in the raised exception In previous code, the 'details' key in error response body is missed in the raised exceptions. This patch will reserve it. Change-Id: Idb10c05135d2cbf5a90adbaa812abfb9ef0d153d --- vmware_nsxlib/v3/client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vmware_nsxlib/v3/client.py b/vmware_nsxlib/v3/client.py index 55ca03cc..a2aaf402 100644 --- a/vmware_nsxlib/v3/client.py +++ b/vmware_nsxlib/v3/client.py @@ -47,7 +47,10 @@ def get_http_error_details(response): for error in msg.get('related_errors', []) if error.get('httpStatus')] + details = msg.get('details') msg = msg['error_message'] + if details: + msg += " details: %s" % details if related_errors: msg += " relatedErrors: %s" % ' '.join(related_errors)