Exceptions

Base exceptions

Base exceptions for errors returned by Vuforia Web Services or the Vuforia Cloud Recognition Web API.

exception vws.exceptions.base_exceptions.CloudRecoError(response: Response)

Bases: Exception

Base class for Vuforia Cloud Recognition Web API exceptions.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.base_exceptions.VWSError(response: Response)

Bases: Exception

Base class for Vuforia Web Services errors.

These errors are defined at https://library.vuforia.com/web-api/cloud-targets-web-services-api#result-codes.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

VWS exceptions

Exception raised when Vuforia returns a response with a result code matching one of those documented at https://library.vuforia.com/web-api/cloud-targets-web-services-api#result-codes.

exception vws.exceptions.vws_exceptions.UnknownTargetError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘UnknownTarget’.

Parameters:

response – The response to a request to Vuforia.

property target_id: str

The unknown target ID.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.FailError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘Fail’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.BadImageError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘BadImage’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.AuthenticationFailureError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘AuthenticationFailure’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.RequestQuotaReachedError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘RequestQuotaReached’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.TargetStatusProcessingError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘TargetStatusProcessing’.

Parameters:

response – The response to a request to Vuforia.

property target_id: str

The processing target ID.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.DateRangeError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘DateRangeError’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.TargetQuotaReachedError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘TargetQuotaReached’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.ProjectSuspendedError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘ProjectSuspended’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.ProjectHasNoAPIAccessError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘ProjectHasNoAPIAccess’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.ProjectInactiveError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘ProjectInactive’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.MetadataTooLargeError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘MetadataTooLarge’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.RequestTimeTooSkewedError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘RequestTimeTooSkewed’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.TargetNameExistError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘TargetNameExist’.

Parameters:

response – The response to a request to Vuforia.

property target_name: str

The target name which already exists.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.ImageTooLargeError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘ImageTooLarge’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.TargetStatusNotSuccessError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘TargetStatusNotSuccess’.

Parameters:

response – The response to a request to Vuforia.

property target_id: str

The unknown target ID.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.vws_exceptions.TooManyRequestsError(response: Response)

Bases: VWSError

Exception raised when Vuforia returns a response with a result code ‘TooManyRequests’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

CloudRecoService exceptions

Exceptions which match errors raised by the Vuforia Cloud Recognition Web APIs.

exception vws.exceptions.cloud_reco_exceptions.MaxNumResultsOutOfRangeError(response: Response)

Bases: CloudRecoError

Exception raised when the max_num_results given to the Cloud Recognition Web API query endpoint is out of range.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.cloud_reco_exceptions.InactiveProjectError(response: Response)

Bases: CloudRecoError

Exception raised when Vuforia returns a response with a result code ‘InactiveProject’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.cloud_reco_exceptions.BadImageError(response: Response)

Bases: CloudRecoError

Exception raised when Vuforia returns a response with a result code ‘BadImage’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.cloud_reco_exceptions.AuthenticationFailureError(response: Response)

Bases: CloudRecoError

Exception raised when Vuforia returns a response with a result code ‘AuthenticationFailure’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.cloud_reco_exceptions.RequestTimeTooSkewedError(response: Response)

Bases: CloudRecoError

Exception raised when Vuforia returns a response with a result code ‘RequestTimeTooSkewed’.

Parameters:

response – The response to a request to Vuforia.

property response: Response

The response returned by Vuforia which included this error.

Custom exceptions

Exceptions which do not map to errors at https://library.vuforia.com/web-api/cloud-targets-web-services-api#result-codes or simple errors given by the cloud recognition service.

exception vws.exceptions.custom_exceptions.OopsAnErrorOccurredPossiblyBadNameError(response: Response)

Bases: Exception

Exception raised when VWS returns an HTML page which says “Oops, an error occurred”.

This has been seen to happen when the given name includes a bad character.

Parameters:

response – The response returned by Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.custom_exceptions.RequestEntityTooLargeError(response: Response)

Bases: Exception

Exception raised when the given image is too large.

Parameters:

response – The response returned by Vuforia.

property response: Response

The response returned by Vuforia which included this error.

exception vws.exceptions.custom_exceptions.TargetProcessingTimeoutError

Bases: Exception

Exception raised when waiting for a target to be processed times out.

exception vws.exceptions.custom_exceptions.ServerError(response: Response)

Bases: Exception

Exception raised when VWS returns a server error.

Parameters:

response – The response returned by Vuforia.

property response: Response

The response returned by Vuforia which included this error.

Response

Responses for exceptions.

class vws.exceptions.response.Response(text: str, url: str, status_code: int, headers: dict[str, str], request_body: bytes | str | None)

A response from a request.

text: str
url: str
status_code: int
headers: dict[str, str]
request_body: bytes | str | None