Skip to content

chore: improve default error handling(#1409)#1433

Draft
Alexj9837 wants to merge 3 commits intoDiamondLightSource:mainfrom
Alexj9837:chore-_improve_default_error_handling(#1409)
Draft

chore: improve default error handling(#1409)#1433
Alexj9837 wants to merge 3 commits intoDiamondLightSource:mainfrom
Alexj9837:chore-_improve_default_error_handling(#1409)

Conversation

@Alexj9837
Copy link

Fixes #1379
Fixes #1409

Both issues related to error handling in the REST client.

#1379 - String matching in check_connection broke in #935 when the
error format changed to include the status code.
Fixed by catching 'UnauthorisedAccessError' instead of string matching, this was fixed in 1409

#1409 - Expanded the exception handler to raise different types per
status code rather than bundling everything into BlueskyRemoteControlError.

@Alexj9837 Alexj9837 force-pushed the chore-_improve_default_error_handling(#1409) branch from a52d61d to 84085eb Compare March 6, 2026 11:53
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.16%. Comparing base (2e8842f) to head (f9ef5d5).

Files with missing lines Patch % Lines
src/blueapi/cli/cli.py 87.50% 1 Missing ⚠️
src/blueapi/client/rest.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1433      +/-   ##
==========================================
- Coverage   95.19%   95.16%   -0.03%     
==========================================
  Files          43       43              
  Lines        3119     3126       +7     
==========================================
+ Hits         2969     2975       +6     
- Misses        150      151       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Alexj9837 Alexj9837 changed the title Chore improve default error handling(#1409) chore: improve default error handling(#1409) Mar 6, 2026
@Alexj9837 Alexj9837 force-pushed the chore-_improve_default_error_handling(#1409) branch from 84085eb to f9ef5d5 Compare March 6, 2026 14:50
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.

Improve default error handling Remove stacktrace from error message when not logged into CLI

1 participant