include HTTP status code in error message
@@ -169,6 +169,7 @@ class cli_api_error():
"""
def __init__(self, f):
self.f = f
+ # this is needed for click help docs to work properly
self.__doc__ = f.__doc__
def __call__(self, *args, **kwargs):
@@ -185,7 +186,7 @@ class cli_api_error():
else:
msg = 'Unknown error'
except ValueError:
- msg = 'Unable to parse error as JSON, received: ' + e.response.text
+ msg = f'Unable to parse {e.response.status_code} error as JSON: {e.response.text}'
except InvalidAuthType as e:
msg = "This command requires application authentication, try passing --app-auth"
except ValueError as e:
