drivendataorg / drivendataorg/cloudpathlib

Wrap exceptions from cloud SDKs

Ouverte
#167 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
design decision enhancement
Langage dominant
Python
Étoiles
628
Forks
88
Merge moyen
17 h 28 min
PR mergées (30 j)
2

Description

The current implementation does not intercept exceptions thrown by the various underlying cloud apis. As a result, it is up to the user to import those from the underlying libraries if they want to handle them. This detracts from the abstraction provided by this library. Users have to write cloud-specific code to handle errors due to authentication or connection failures.

It would be nice if an attempt was made to catch these exceptions and wrap them with an appropriate exception type provided by this library.

I don't want to have to write code like this:

```python
from azure.core.exceptions import ClientAuthenticationError
from botocore.exceptions import NoCredentialsError

try:
path = CloudPath(somepath)
with path.open():
...
except (ClientAuthenticationError, NoCredentialsError,...):

```

And if I need to worry about what implementation libraries are installed the code becomes even more horrible.

I would rather have cloudpathlib intercept those exceptions and wrap them with its own exceptions so I could write something like:

```python
from cloudpathlib import AuthenticationError

try:
path = CloudPath(somepath)
with path.open():
...
except AuthenticationError:

```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par CloudPath et suivez le cheminement pour déterminer où les API cloud sous-jacentes lèvent des exceptions d’authentification et de connexion. Déterminez les catégories d’exceptions au niveau de la bibliothèque et les correspondances des fournisseurs, puis vérifiez que les appelants peuvent gérer ces échecs sans importer d’exceptions spécifiques aux SDK cloud.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, azure, google-cloud, python
Domaine
cloud
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.