Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #9

Merged
merged 4 commits into from
Jul 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add error props
  • Loading branch information
JJ11teen committed Jul 4, 2022
commit 36f0ddff08a1c103745f537e45628bb65fe49f02
12 changes: 12 additions & 0 deletions src/cloudmappings/errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
class KeySyncError(ValueError):
storage_provider_name: str
key: str
expected_etag: str

def __init__(self, storage_provider_name: str, key: str, etag: str) -> None:
self.storage_provider_name = storage_provider_name
self.key = key
self.expected_etag = etag
super().__init__(
f"Mapping is out of sync with cloud data.\n"
f"Cloud storage: '{storage_provider_name}'\n"
Expand All @@ -8,7 +15,12 @@ def __init__(self, storage_provider_name: str, key: str, etag: str) -> None:


class ValueSizeError(ValueError):
storage_provider_name: str
key: str

def __init__(self, storage_provider_name: str, key: str) -> None:
self.storage_provider_name = storage_provider_name
self.key = key
super().__init__(
f"Value is too big to fit in cloud.\n" f"Cloud storage: '{storage_provider_name}'\n" f"Key: '{key}'"
)