drivendataorg / drivendataorg/cloudpathlib

Wrap exceptions from cloud SDKs

オープン
#167 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
design decision enhancement
主要言語
Python
スター
628
フォーク
88
平均マージ
17時間 28分
マージ済み PR(30日)
2

説明

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:

```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

CloudPath から開始し、基盤となる cloud API が認証例外と接続例外を発生させる箇所をたどってください。ライブラリレベルの例外カテゴリとプロバイダーの対応関係を特定し、そのうえで、呼び出し元が cloud 固有の SDK 例外をインポートせずにこれらの失敗を処理できることを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, azure, google-cloud, python
領域
cloud
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。