-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
83 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
""" | ||
exceptions | ||
Custom exception classes for the CS3 client. | ||
Where applicable, the default values correspond to the Linux standard error strings. | ||
Authors: Rasmus Welander, Diogo Castro, Giuseppe Lo Presti. | ||
Emails: [email protected], [email protected], [email protected] | ||
Last updated: 01/08/2024 | ||
""" | ||
|
||
|
||
class AuthenticationException(Exception): | ||
""" | ||
Standard error thrown when attempting an operation without the required access rights | ||
""" | ||
|
||
def __init__(self, message: str = "Operation not permitted"): | ||
super().__init__(message) | ||
|
||
|
||
class NotFoundException(IOError): | ||
""" | ||
Standard file missing message | ||
""" | ||
|
||
def __init__(self, message: str = "No such file or directory"): | ||
super().__init__(message) | ||
|
||
|
||
class SecretNotSetException(Exception): | ||
""" | ||
Standard file missing message | ||
""" | ||
|
||
def __init__(self, message: str = "Secret was not set, unable to authenticate"): | ||
super().__init__(message) | ||
|
||
|
||
class FileLockedException(IOError): | ||
""" | ||
Standard error thrown when attempting to overwrite a file/xattr with a mistmatched lock, | ||
or when a lock operation cannot be performed because of failed preconditions | ||
""" | ||
|
||
def __init__(self, message: str = "Lock mismatch"): | ||
super().__init__(message) | ||
|
||
|
||
class UnknownException(Exception): | ||
""" | ||
Standard exception to be thrown when we get an error that is unknown, e.g. not defined in the cs3api | ||
""" | ||
|
||
def __init__(self, message: str = ""): | ||
super().__init__(message) | ||
|
||
|
||
class AlreadyExistsException(IOError): | ||
""" | ||
Standard error thrown when attempting to create a resource that already exists | ||
""" | ||
|
||
def __init__(self, message: str = "File exists"): | ||
super().__init__(message) | ||
|
||
|
||
class UnimplementedException(Exception): | ||
""" | ||
Standard error thrown when attempting to use a feature that is not implemented | ||
""" | ||
|
||
def __init__(self, message: str = "Not implemented"): | ||
super().__init__(message) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
exceptions Module | ||
================= | ||
|
||
.. automodule:: exceptions.exceptions | ||
.. automodule:: exceptions | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters