Skip to content

chore: improve default error handling 1379 1409#1491

Open
Alexj9837 wants to merge 12 commits intomainfrom
chore/improve-default-error-handling-1379-1409
Open

chore: improve default error handling 1379 1409#1491
Alexj9837 wants to merge 12 commits intomainfrom
chore/improve-default-error-handling-1379-1409

Conversation

@Alexj9837
Copy link
Copy Markdown

Fixes #1379
Fixes #1409

Both issues related to error handling in the REST client.

1379 - Catches 'UnauthorisedAccessErrorexplicitly instead of string-matching onBlueskyRemoteControlError`.

1409 - Expands the exception hierarchy so each
HTTP status code raises a distinct typed exception rather than bundling
everything into BlueskyRemoteControlError.
Tests

Update tests to match new exception signatures
Add missing coverage for 422 non-list detail response
Add missing coverage for streaming error in run command

Alexj9837 and others added 12 commits March 17, 2026 13:33
Poor grammar.

Co-authored-by: Peter Holloway <peter.holloway@diamond.ac.uk>
… having an effect when running plans - you'll still get the Unauthorised request message"
rebased from main to fix merge conflicts

---------

Co-authored-by: Shreelakshmi Iyengar <shreelakshmi.iyengar@diamond.ac.uk>
Co-authored-by: Zoheb Shaikh <zoheb.shaikh@diamond.ac.uk>
Co-authored-by: Daniel Fernandes <65790536+dan-fernandes@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com>
Co-authored-by: Abigail Emery <abigail.emery@diamond.ac.uk>
Co-authored-by: oliwenmandiamond <136330507+oliwenmandiamond@users.noreply.github.com>
Co-authored-by: Peter Holloway <peter.holloway@diamond.ac.uk>
Co-authored-by: NeilSmithDLS <118457264+NeilSmithDLS@users.noreply.github.com>
Removed duplicate BlueskyRequestError exception class from rest.py.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.24%. Comparing base (9f15b40) to head (135cd15).

Files with missing lines Patch % Lines
src/blueapi/client/rest.py 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1491      +/-   ##
==========================================
+ Coverage   95.22%   95.24%   +0.01%     
==========================================
  Files          43       43              
  Lines        3144     3154      +10     
==========================================
+ Hits         2994     3004      +10     
  Misses        150      150              

☔ 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 marked this pull request as ready for review April 16, 2026 14:47
@Alexj9837 Alexj9837 requested a review from a team as a code owner April 16, 2026 14:47
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