Skip to content

Unclear error message when plan does not exists #299

Closed

Description

@DominicOram

When trying to run blueapi controller run non_existent_plan I get:

Traceback (most recent call last):
  File "/scratch/ffv81422/testing_blueapi/.venv/bin/blueapi", line 8, in <module>
    sys.exit(main())
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/blueapi/cli/cli.py", line 105, in wrapper
    func(*args, **kwargs)
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/blueapi/cli/cli.py", line 161, in run_plan
    resp = client.create_task(task)
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/blueapi/cli/rest.py", line 68, in create_task
    return self._request_and_deserialize(
  File "/scratch/ffv81422/testing_blueapi/.venv/lib/python3.10/site-packages/blueapi/cli/rest.py", line 111, in _request_and_deserialize
    raise BlueskyRemoteError(str(response))
blueapi.cli.amq.BlueskyRemoteError: <Response [404]>

As a user this is not obvious to me that it's because the plan doesn't exist. Would be good to get an error message saying non_existent_plan doesn't exist and listing which plans do exist

Activity

  1. changed the title [-]Unclear error message when no plan exists[/-] [+]Unclear error message when plan does not exists[/+] on Aug 17, 2023
  2. callumforrester commented on Aug 18, 2023

    @callumforrester
    Contributor

    This should be handled in the CLI client, a 404 from the server means "plan not found", so can just catch that case and produce an appropriate error message.

  3. added
    bug
    enhancement
    on Aug 18, 2023
  4. added 2 commits that reference this issue on Sep 21, 2023
    636062a
    968ff90
  5. tpoliaw commented on Jun 23, 2025

    @tpoliaw
    Contributor

    Think this is fixed now

    $ blueapi controller run foo_bar
    Error: Plan 'foo_bar' was not recognised
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions