drivendataorg / drivendataorg/cloudpathlib
Wrap exceptions from cloud SDKs
- Ngôn ngữ chính
- Python
- Star
- 628
- Fork
- 88
- Merge trung bình
- 17 giờ 28 phút
- Pull request đã merge (30 ngày)
- 2
Mô tả
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:
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu từ CloudPath và lần theo nơi các cloud API bên dưới phát sinh các exception về xác thực và kết nối. Xác định các nhóm exception ở cấp thư viện và ánh xạ provider, sau đó xác minh rằng các caller có thể xử lý những lỗi này mà không cần import các exception SDK dành riêng cho cloud.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, azure, google-cloud, python
- Lĩnh vực
- cloud
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 30/100