Exceptions

exception pycpg.exceptions.PycpgActiveLegalHoldError(exception, resource, resource_id)

Bases: PycpgBadRequestError

An exception raised when attempting to deactivate a user or device that is in an active legal hold.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property resource

The user or device resource.

property resource_id

The resource ID.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgArchiveFileNotFoundError(response, device_guid, file_path)

Bases: PycpgResponseError

An exception raised when a resource file is not found or the path is invalid.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property device_guid

The device GUID provided.

property file_path

The file path provided.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgBadRequestError(exception, message=None, *args)

Bases: PycpgHTTPError

A wrapper to represent an HTTP 400 error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgBadRestoreRequestError(exception)

Bases: PycpgBadRequestError

An error raised when the given restore arguments are not compatible and cause a bad request.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgChecksumNotFoundError(response, checksum_name, checksum_value)

Bases: PycpgResponseError

An exception raised when a user-supplied hash could not successfully locate its corresponding resource.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property checksum_name

The checksum name.

property checksum_value

The checksum value.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgConflictError(exception, message=None, *args)

Bases: PycpgHTTPError

A wrapper to represent an HTTP 409 error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgDeviceNotConnectedError(response, device_guid)

Bases: PycpgResponseError

An exception raised when trying to push a restore to a device that is not connected to an Authority server.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property device_guid

The device GUID.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgError

Bases: Exception

A generic, Pycpg custom base exception.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgFeatureUnavailableError(response)

Bases: PycpgResponseError

An exception raised when a requested feature is not supported in your CrashPlan environment.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgForbiddenError(exception, message=None, *args)

Bases: PycpgHTTPError

A wrapper to represent an HTTP 403 error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgHTTPError(exception, message=None, *args)

Bases: PycpgResponseError

A base custom class to manage all HTTP errors raised by an API endpoint.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgInternalServerError(exception, message=None, *args)

Bases: PycpgHTTPError

A wrapper to represent an HTTP 500 error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgInvalidArchiveEncryptionKey(exception)

Bases: PycpgHTTPError

An exception raised the encryption key for an archive is invalid.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgInvalidArchivePassword(exception)

Bases: PycpgHTTPError

An exception raised when the password for unlocking an archive is invalid.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgInvalidEmailError(email, exception)

Bases: PycpgInternalServerError

An exception raised when trying to set an invalid email as a user’s email.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property email

The email being assigned to a user.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgInvalidPageTokenError(exception, page_token)

Bases: PycpgBadRequestError

An error raised when the page token given is invalid.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property page_token

The page token.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgInvalidPasswordError(exception)

Bases: PycpgInternalServerError

An exception raised when trying to set an invalid password as a user’s password.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgInvalidUsernameError(exception)

Bases: PycpgInternalServerError

An exception raised when trying to set an invalid username as a user’s username.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgLegalHoldAlreadyActiveError(exception, legal_hold_matter_uid)

Bases: PycpgBadRequestError

An exception raised when trying to activate a Legal Hold Matter that is already active.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property legal_hold_matter_uid

The legal hold matter UID.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgLegalHoldAlreadyDeactivatedError(exception, legal_hold_matter_uid)

Bases: PycpgBadRequestError

An exception raised when trying to deactivate a Legal Hold Matter that is already inactive.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property legal_hold_matter_uid

The legal hold matter UID.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgLegalHoldCriteriaMissingError(exception)

Bases: PycpgBadRequestError

An exception raised when a bad request was made to a Legal Hold endpoint.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgLegalHoldNotFoundOrPermissionDeniedError(exception, resource_uid, legal_hold_resource='matter')

Bases: PycpgForbiddenError

An exception raised when a legal hold matter is inaccessible from your account or the matter UID is not valid.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

property uid

The UID of the legal hold resource.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgMFARequiredError(exception, message=None)

Bases: PycpgUnauthorizedError

Deprecated: An exception raised when a request requires multi-factor authentication

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgNotFoundError(exception, message=None, *args)

Bases: PycpgHTTPError

A wrapper to represent an HTTP 404 error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgOrgNotFoundError(exception, org_uid)

Bases: PycpgBadRequestError

An exception raised when a 400 HTTP error message indicates that an organization was not found.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property org_uid

“ The org UID.

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgResponseError(response, message, *args)

Bases: PycpgError

A base custom class to manage all errors raised because of an HTTP response.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgSessionInitializationError(exception)

Bases: PycpgError

An exception raised when a user connection is invalid. A connection might be invalid due to connection timeout, invalid token, etc.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgStorageSessionInitializationError(exception, message)

Bases: PycpgHTTPError

An exception raised when the user is not authorized to initialize a storage session. This may occur when trying to restore a file or trying to get events for file activity on removable media, in cloud sync folders, and browser uploads.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgTooManyRequestsError(exception, message=None, *args)

Bases: PycpgHTTPError

A wrapper to represent an HTTP 429 error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgUnauthorizedError(exception, message=None, *args)

Bases: PycpgHTTPError

A wrapper to represent an HTTP 401 error.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgUserAlreadyAddedError(exception, user_id, list_name)

Bases: PycpgBadRequestError

An exception raised when the user is already added to group or list, such as the Departing Employee list.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

property user_id

The user ID.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgUserAlreadyExistsError(exception, message=None)

Bases: PycpgInternalServerError

An exception raised when a user already exists

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception pycpg.exceptions.PycpgUsernameMustBeEmailError(exception)

Bases: PycpgInternalServerError

An exception raised when trying to set a non-email as a user’s username in a cloud environment.

add_note(object, /)

Exception.add_note(note) – add a note to the exception

property response

The response prior to the error.

with_traceback(object, /)

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

pycpg.exceptions.raise_pycpg_error(raised_error)

Raises the appropriate pycpg.exceptions.PycpgHttpError based on the given HTTPError’s response status code.