Exceptions

Base exceptions

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

exception vws.exceptions.base_exceptions.CloudRecoException(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.VWSException(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.UnknownTarget(response: Response)

Bases: VWSException

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.Fail(response: Response)

Bases: VWSException

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.BadImage(response: Response)

Bases: VWSException

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.AuthenticationFailure(response: Response)

Bases: VWSException

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.RequestQuotaReached(response: Response)

Bases: VWSException

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.TargetStatusProcessing(response: Response)

Bases: VWSException

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: VWSException

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.TargetQuotaReached(response: Response)

Bases: VWSException

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.ProjectSuspended(response: Response)

Bases: VWSException

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.ProjectHasNoAPIAccess(response: Response)

Bases: VWSException

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.ProjectInactive(response: Response)

Bases: VWSException

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.MetadataTooLarge(response: Response)

Bases: VWSException

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.RequestTimeTooSkewed(response: Response)

Bases: VWSException

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.TargetNameExist(response: Response)

Bases: VWSException

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.ImageTooLarge(response: Response)

Bases: VWSException

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.TargetStatusNotSuccess(response: Response)

Bases: VWSException

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.TooManyRequests(response: Response)

Bases: VWSException

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.MaxNumResultsOutOfRange(response: Response)

Bases: CloudRecoException

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.InactiveProject(response: Response)

Bases: CloudRecoException

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.BadImage(response: Response)

Bases: CloudRecoException

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.AuthenticationFailure(response: Response)

Bases: CloudRecoException

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.RequestTimeTooSkewed(response: Response)

Bases: CloudRecoException

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.OopsAnErrorOccurredPossiblyBadName(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.RequestEntityTooLarge(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.TargetProcessingTimeout

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