From 0600e5f7556ff2e7b96f7f6fdb55fc224c2ab7e7 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Tue, 7 Jan 2020 16:54:33 -0800 Subject: [PATCH 1/2] Docstring of AzureError --- sdk/core/azure-core/azure/core/exceptions.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sdk/core/azure-core/azure/core/exceptions.py b/sdk/core/azure-core/azure/core/exceptions.py index 6b9100c3cbec..873667c404ca 100644 --- a/sdk/core/azure-core/azure/core/exceptions.py +++ b/sdk/core/azure-core/azure/core/exceptions.py @@ -83,7 +83,20 @@ def map_error(status_code, response, error_map): raise error class AzureError(Exception): - """Base exception for all errors.""" + """Base exception for all errors. + + :param message: The message object stringified as 'message' attribute + :keyword error: The original exception if any + :paramtype error: Exception + + :ivar inner_exception: The exception passes with the 'error' kwarg + :type inner_exception: Exception + :ivar exc_type: The exc_type from sys.exc_info() + :ivar exc_value: The exc_value from sys.exc_info() + :ivar exc_traceback: The exc_traceback from sys.exc_info() + :ivar exc_msg: A string formatting of message parameter, exc_type and exc_value + :ivar str message: A stringified version of the message parameter + """ def __init__(self, message, *args, **kwargs): self.inner_exception = kwargs.get('error') @@ -120,6 +133,9 @@ class HttpResponseError(AzureError): :type message: string :param response: The response that triggered the exception. :type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse + + :ivar reason: The HTTP response reason + :type reason: str :ivar status_code: HttpResponse's status code :type status_code: int :ivar response: The response that triggered the exception. From 17002fcd04f924b092775ef25ea1782a95e4fcab Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 5 Feb 2020 16:48:40 -0800 Subject: [PATCH 2/2] Update exceptions.py --- sdk/core/azure-core/azure/core/exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/azure/core/exceptions.py b/sdk/core/azure-core/azure/core/exceptions.py index 873667c404ca..7774659a0f69 100644 --- a/sdk/core/azure-core/azure/core/exceptions.py +++ b/sdk/core/azure-core/azure/core/exceptions.py @@ -89,7 +89,7 @@ class AzureError(Exception): :keyword error: The original exception if any :paramtype error: Exception - :ivar inner_exception: The exception passes with the 'error' kwarg + :ivar inner_exception: The exception passed with the 'error' kwarg :type inner_exception: Exception :ivar exc_type: The exc_type from sys.exc_info() :ivar exc_value: The exc_value from sys.exc_info()