Azure / Azure/azure-storage-python

expose AzureSigningError properly and make it self-explanatory

Open
#565 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
343
Forks
243
PR merge metrics
No merged PRs in 30d

Description

### Which service(blob, file, queue) does this issue concern?

Any.

### Which version of the SDK was used? Please provide the output of `pip freeze`.

asn1crypto==0.24.0
astroid==2.2.5
azure-common==1.1.18
azure-functions==1.0.0b3
azure-functions-worker==1.0.0b4
azure-storage-blob==1.5.0
azure-storage-common==1.4.0
azure-storage-queue==1.4.0
certifi==2019.3.9
cffi==1.12.2
chardet==3.0.4
colorama==0.4.1
cryptography==2.6.1
grpcio==1.14.2
grpcio-tools==1.14.2
idna==2.8
isort==4.3.16
lazy-object-proxy==1.3.1
mccabe==0.6.1
protobuf==3.7.0
pycparser==2.19
pylint==2.3.1
python-dateutil==2.8.0
requests==2.21.0
six==1.12.0
typed-ast==1.3.1
urllib3==1.24.1
wrapt==1.11.1

### What problem was encountered?

AzureSigningError is the error class associated with connections to Azure Storage failing due to providing the wrong account credentials. Users of the SDK will come across this error being raised frequently and should thus be encouraged to catch it with `try … except` specifically.

AzureSigningError is not really exposed for easy use, requiring an import as such

```python
from azure.storage.common._error import AzureSigningError
```

Like other errors that can occur specifically when performing API operations, it should have a more obvious import, comparable to

```python
from azure.common import AzureConflictHttpError
```

Also, the error message that comes with the object is not really helpful. Providing incorrect storage account credentials results in "Incorrect Padding". There is no HTTP response code associated with the error object (like with `azure.common.AzureHttpError`). It would really help if error handling in the storage SDK behaves in the same way as with `azure.common`.

### Have you found a mitigation/solution?

No.
Note: for table service, please post the issue here instead: https://github.com/Azure/azure-cosmosdb-python.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.