Skip to content

Extract error message handling to _error_handling module#1988

Merged
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/extract-small-refactor
Feb 22, 2026
Merged

Extract error message handling to _error_handling module#1988
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/extract-small-refactor

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 22, 2026

Summary

Move the error message mapping logic from commands.py to a new _error_handling.py module and expose it as a public get_error_message function. This allows other CLI modules to reuse the same error handling logic.

Changes

  • Created src/vws_cli/_error_handling.py with the extracted error message function
  • Updated src/vws_cli/commands.py to import and use the new module
  • Removed unused imports from commands.py

Test plan

  • Imports work correctly
  • Pre-commit hooks pass
  • Error messages remain unchanged

Note

Low Risk
Pure refactor that centralizes error-message mapping; behavior should remain the same aside from potential import/path issues.

Overview
Extracts VWS exception-to-message formatting from commands.py into a new vws_cli/_error_handling.py module as get_error_message.

commands.py now imports and uses get_error_message in _handle_vws_exceptions, and removes the inlined helper plus now-unused exception/import types.

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

Move the _get_error_message function from commands.py to a new _error_handling.py module and make it public as get_error_message. This allows other modules to reuse the error handling logic.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@adamtheturtle adamtheturtle merged commit c6cbcd5 into main Feb 22, 2026
16 checks passed
@adamtheturtle adamtheturtle deleted the adamtheturtle/extract-small-refactor branch February 22, 2026 01: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