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
16
17
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
20
21
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
24
25
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
28
29
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
32
33
class SynapseTimeoutError(SynapseError):
    """Timed out waiting for response from Synapse."""

SynapseAuthenticationError

Bases: SynapseError

Authentication errors.

Source code in synapseclient/core/exceptions.py
36
37
class SynapseAuthenticationError(SynapseError):
    """Authentication errors."""

SynapseAuthorizationError

Bases: SynapseError

Authorization errors.

Source code in synapseclient/core/exceptions.py
40
41
class SynapseAuthorizationError(SynapseError):
    """Authorization errors."""

SynapseNoCredentialsError

Bases: SynapseAuthenticationError

No credentials for authentication

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

SynapseFileCacheError

Bases: SynapseError

Error related to local file storage.

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

SynapseMalformedEntityError

Bases: SynapseError

Unexpected structure of Entities.

Source code in synapseclient/core/exceptions.py
52
53
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
56
57
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
60
61
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
64
65
66
67
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
70
71
72
class SynapseUploadAbortedException(SynapseError):
    """Raised when a worker thread detects the upload was
    aborted and stops further processing."""

SynapseDownloadAbortedException

Bases: SynapseError

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

Source code in synapseclient/core/exceptions.py
75
76
77
class SynapseDownloadAbortedException(SynapseError):
    """Raised when a worker thread detects the download 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
80
81
class SynapseUploadFailedException(SynapseError):
    """Raised when an upload failed. Should be chained to a cause Exception"""