Skip to content

Exceptions

synapseclient.core.exceptions

Contains all of the exceptions that can be thrown within this Python client as well as handling error cases for HTTP requests.

Classes

SynapseError

Bases: Exception

Generic exception thrown by the client.

Source code in synapseclient/core/exceptions.py
13
14
class SynapseError(Exception):
    """Generic exception thrown by the client."""

SynapseMd5MismatchError

Bases: SynapseError, IOError

Error raised when MD5 computed for a download file fails to match the MD5 of its file handle.

Source code in synapseclient/core/exceptions.py
17
18
class SynapseMd5MismatchError(SynapseError, IOError):
    """Error raised when MD5 computed for a download file fails to match the MD5 of its file handle."""

SynapseFileNotFoundError

Bases: SynapseError

Error thrown when a local file is not found in Synapse.

Source code in synapseclient/core/exceptions.py
21
22
class SynapseFileNotFoundError(SynapseError):
    """Error thrown when a local file is not found in Synapse."""

SynapseNotFoundError

Bases: SynapseError

Error thrown when a requested resource is not found in Synapse.

Source code in synapseclient/core/exceptions.py
25
26
class SynapseNotFoundError(SynapseError):
    """Error thrown when a requested resource is not found in Synapse."""

SynapseTimeoutError

Bases: SynapseError

Timed out waiting for response from Synapse.

Source code in synapseclient/core/exceptions.py
29
30
class SynapseTimeoutError(SynapseError):
    """Timed out waiting for response from Synapse."""

SynapseAuthenticationError

Bases: SynapseError

Unauthorized access.

Source code in synapseclient/core/exceptions.py
33
34
class SynapseAuthenticationError(SynapseError):
    """Unauthorized access."""

SynapseNoCredentialsError

Bases: SynapseAuthenticationError

No credentials for authentication

Source code in synapseclient/core/exceptions.py
37
38
class SynapseNoCredentialsError(SynapseAuthenticationError):
    """No credentials for authentication"""

SynapseFileCacheError

Bases: SynapseError

Error related to local file storage.

Source code in synapseclient/core/exceptions.py
41
42
class SynapseFileCacheError(SynapseError):
    """Error related to local file storage."""

SynapseMalformedEntityError

Bases: SynapseError

Unexpected structure of Entities.

Source code in synapseclient/core/exceptions.py
45
46
class SynapseMalformedEntityError(SynapseError):
    """Unexpected structure of Entities."""

SynapseUnmetAccessRestrictions

Bases: SynapseError

Request cannot be completed due to unmet access restrictions.

Source code in synapseclient/core/exceptions.py
49
50
class SynapseUnmetAccessRestrictions(SynapseError):
    """Request cannot be completed due to unmet access restrictions."""

SynapseProvenanceError

Bases: SynapseError

Incorrect usage of provenance objects.

Source code in synapseclient/core/exceptions.py
53
54
class SynapseProvenanceError(SynapseError):
    """Incorrect usage of provenance objects."""

SynapseHTTPError

Bases: SynapseError, HTTPError

Wraps recognized HTTP errors. See HTTPError <http://docs.python-requests.org/en/latest/api/?highlight=exceptions#requests.exceptions.HTTPError>_

Source code in synapseclient/core/exceptions.py
57
58
59
60
class SynapseHTTPError(SynapseError, requests.exceptions.HTTPError):
    """Wraps recognized HTTP errors.  See
    `HTTPError <http://docs.python-requests.org/en/latest/api/?highlight=exceptions#requests.exceptions.HTTPError>`_
    """

SynapseUploadAbortedException

Bases: SynapseError

Raised when a worker thread detects the upload was aborted and stops further processing.

Source code in synapseclient/core/exceptions.py
63
64
65
class SynapseUploadAbortedException(SynapseError):
    """Raised when a worker thread detects the upload was
    aborted and stops further processing."""

SynapseUploadFailedException

Bases: SynapseError

Raised when an upload failed. Should be chained to a cause Exception

Source code in synapseclient/core/exceptions.py
68
69
class SynapseUploadFailedException(SynapseError):
    """Raised when an upload failed. Should be chained to a cause Exception"""