drivendataorg / drivendataorg/cloudpathlib
Wrap exceptions from cloud SDKs
- Lingua principale
- Python
- Stelle
- 628
- Fork
- 88
- Merge medio
- 17h 28m
- PR unite (30g)
- 2
Descrizione
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:
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Parti da CloudPath e segui il percorso per determinare dove le API cloud sottostanti generano eccezioni di autenticazione e connessione. Determina le categorie di eccezioni a livello di libreria e le corrispondenze dei provider, quindi verifica che i chiamanti possano gestire questi errori senza importare eccezioni specifiche degli SDK cloud.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, azure, google-cloud, python
- Ambito
- cloud
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 30/100