From a26c8f9f528228e748e995279cbb54b73d64b3f5 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 10 Sep 2026 18:51:01 +0100 Subject: [PATCH] Cover imported exception classes --- src/vws/exceptions/custom_exceptions.py | 2 +- src/vws/exceptions/vws_exceptions.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/vws/exceptions/custom_exceptions.py b/src/vws/exceptions/custom_exceptions.py index 70ec81e36..660b20709 100644 --- a/src/vws/exceptions/custom_exceptions.py +++ b/src/vws/exceptions/custom_exceptions.py @@ -90,7 +90,7 @@ class RecoCountsReportTimeoutError(Exception): @beartype -class ServerError(Exception): # pragma: no cover +class ServerError(Exception): """Exception raised when VWS returns a server error.""" def __init__(self, response: Response) -> None: diff --git a/src/vws/exceptions/vws_exceptions.py b/src/vws/exceptions/vws_exceptions.py index 4dc01407d..86e28ba79 100644 --- a/src/vws/exceptions/vws_exceptions.py +++ b/src/vws/exceptions/vws_exceptions.py @@ -84,9 +84,8 @@ def target_id(self) -> str: return _target_id_from_url(url=self.response.url) -# This is not simulated by the mock. @beartype -class DateRangeError(VWSError): # pragma: no cover +class DateRangeError(VWSError): """Exception raised when Vuforia returns a response with a result code 'DateRangeError'. """ @@ -171,16 +170,14 @@ def target_id(self) -> str: @beartype -class TooManyRequestsError(VWSError): # pragma: no cover +class TooManyRequestsError(VWSError): """Exception raised when Vuforia returns a response with a result code 'TooManyRequests'. """ -# This is not simulated by client code because the accept parameter uses -# the VuMarkAccept enum, which only allows valid values. @beartype -class InvalidAcceptHeaderError(VWSError): # pragma: no cover +class InvalidAcceptHeaderError(VWSError): """Exception raised when Vuforia returns a response with a result code ``InvalidAcceptHeader``. """ @@ -193,10 +190,8 @@ class InvalidInstanceIdError(VWSError): """ -# This is not simulated by client code because the request body -# is always valid JSON when using this client. @beartype -class BadRequestError(VWSError): # pragma: no cover +class BadRequestError(VWSError): """Exception raised when Vuforia returns a response with a result code ``BadRequest``. """