Skip to content

Give better error message on non-existant instrument session #1507

Closed

Description

@DominicOram

If I accidentally give a non-existent instrument session when submitting a plan to BlueAPI I get an error like:

RuntimeError: Numtracker error: [{'message': 'Authentication failed', 'locations': [{'line': 3, 'column': 5}], 'path': ['scan']}]

this doesn't really give me any hints to why the authentication has failed.

Acceptance Criteria

  • A failure on the above gives a more useful response like "Visit XXX not found"

Activity

  1. tpoliaw commented on Apr 23, 2026

    @tpoliaw
    Contributor

    We don't really know that the visit doesn't exist, only that the user doesn't have access to the visit they've asked for. If the user is not authenticated they won't get as far as numtracker and the request will give a 401.

    We could make the error along the lines of Not authorized to create scan number for ixx and cm12345-1. Would that be clearer?

  2. DominicOram commented on Apr 23, 2026

    @DominicOram
    ContributorAuthor

    Yh, that'll do, thanks

  3. added
    onboarding
    external
    on Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

externalonboarding

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions