Skip to content

Commit dae7b74

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 6c1c4a4 commit dae7b74

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ optional-dependencies.dev = [
8282
"ty==0.0.17",
8383
"types-requests==2.32.4.20260107",
8484
"vulture==2.14",
85-
"vws-python-mock==2026.2.18.1",
85+
"vws-python-mock==2026.2.18.2",
8686
"vws-test-fixtures==2023.3.5",
8787
"yamlfix==1.19.1",
8888
"zizmor==1.22.0",

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)