Added user-friendly CLI
This commit is contained in:
@@ -20,3 +20,39 @@ class SubmissionDuplicatesError(Exception):
|
||||
super().__init__(
|
||||
f"Found duplicates of a photo '{file_path}': {self.duplicates}"
|
||||
)
|
||||
|
||||
|
||||
class UserCreationError(Exception):
|
||||
def __init__(self, code: int, data: str) -> None:
|
||||
self.code = code
|
||||
self.data = data
|
||||
super().__init__(
|
||||
f"Could not create a new user. API returned HTTP {self.code} with content: {self.data}"
|
||||
)
|
||||
|
||||
|
||||
class UserCreationDuplicateError(Exception):
|
||||
def __init__(self, username: str) -> None:
|
||||
self.username = username
|
||||
super().__init__(f"User '{self.username} already exists.'")
|
||||
|
||||
|
||||
class AlbumCreationError(Exception):
|
||||
def __init__(self, code: int, data: str) -> None:
|
||||
self.code = code
|
||||
self.data = data
|
||||
super().__init__(
|
||||
f"Could not create a new album. API returned HTTP {self.code} with content: {self.data}"
|
||||
)
|
||||
|
||||
|
||||
class AlbumCreationDuplicateError(Exception):
|
||||
def __init__(self, name: str) -> None:
|
||||
self.name = name
|
||||
super().__init__(f"Album '{self.name} already exists.'")
|
||||
|
||||
|
||||
class AlbumCreationNameError(Exception):
|
||||
def __init__(self, data: dict) -> None:
|
||||
self.data = data
|
||||
super().__init__(data["detail"])
|
||||
|
Reference in New Issue
Block a user