Skip to content

Commit f5437a9

Browse files
adamtheturtleclaude
andcommitted
Add BadRequestError and bump vws-python-mock to 2026.2.18.2
Add BadRequestError exception for the BadRequest result code returned by the VuMark endpoint when invalid JSON is sent. Map it in generate_vumark_instance and include it in the exception inheritance test. Bump vws-python-mock to 2026.2.18.2 which adds full VuMark auth endpoint testing support. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 1100913 commit f5437a9

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/vws/exceptions/vws_exceptions.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,12 @@ class InvalidInstanceIdError(VWSError):
183183
"""Exception raised when Vuforia returns a response with a result code
184184
'InvalidInstanceId'.
185185
"""
186+
187+
188+
# This is not simulated by client code because the request body
189+
# is always valid JSON when using this client.
190+
@beartype
191+
class BadRequestError(VWSError): # pragma: no cover
192+
"""Exception raised when Vuforia returns a response with a result code
193+
'BadRequest'.
194+
"""

src/vws/vws.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from vws.exceptions.vws_exceptions import (
2121
AuthenticationFailureError,
2222
BadImageError,
23+
BadRequestError,
2324
DateRangeError,
2425
FailError,
2526
ImageTooLargeError,
@@ -806,6 +807,7 @@ def generate_vumark_instance(
806807

807808
exception = {
808809
"AuthenticationFailure": AuthenticationFailureError,
810+
"BadRequest": BadRequestError,
809811
"DateRangeError": DateRangeError,
810812
"Fail": FailError,
811813
"InvalidAcceptHeader": InvalidAcceptHeaderError,

tests/test_vws_exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from vws.exceptions.vws_exceptions import (
1919
AuthenticationFailureError,
2020
BadImageError,
21+
BadRequestError,
2122
DateRangeError,
2223
FailError,
2324
ImageTooLargeError,
@@ -341,6 +342,7 @@ def test_vwsexception_inheritance() -> None:
341342
subclasses = [
342343
AuthenticationFailureError,
343344
BadImageError,
345+
BadRequestError,
344346
DateRangeError,
345347
FailError,
346348
ImageTooLargeError,

0 commit comments

Comments
 (0)