Skip to content

Centralize VWS result code exception mapping#2885

Merged
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/vwserror-result-code
Feb 25, 2026
Merged

Centralize VWS result code exception mapping#2885
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/vwserror-result-code

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 25, 2026

This centralizes VWS/VuMark result-code exception mapping via VWSError.from_result_code() backed by a registry on VWSError. The mapping is registered once in vws_exceptions.py, avoiding lazy imports while keeping base_exceptions.py free of subclass imports. Sync and async VWS/VuMark clients now raise through the shared factory instead of duplicating inline dictionaries. Added a focused test for VWSError.from_result_code, and uv run --all-extras pytest passes (300 tests).


Note

Medium Risk
Centralizes how HTTP error responses are turned into typed exceptions across sync/async clients; failures in the registry (missing/incorrect result_code mappings) could change which exceptions are raised at runtime, but scope is limited to error handling paths.

Overview
Centralizes VWS/VuMark error mapping. Sync and async VWS/VuMark clients now raise Vuforia result-code errors via a shared VWSError.from_result_code() factory instead of maintaining per-call-site result_code→exception dictionaries.

VWSError gains a registry (register_exceptions_by_result_code) and factory method, with the mapping registered once in vws_exceptions.py. Tests add coverage ensuring from_result_code returns the correct mapped exception instance.

Written by Cursor Bugbot for commit ba1d67e. This will update automatically on new commits. Configure here.

@adamtheturtle adamtheturtle merged commit 85a0fa0 into main Feb 25, 2026
16 checks passed
@adamtheturtle adamtheturtle deleted the adamtheturtle/vwserror-result-code branch February 25, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant