Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error message when plan does not exists #299

Open
DominicOram opened this issue Aug 17, 2023 · 1 comment · May be fixed by #311
Open

Unclear error message when plan does not exists #299

DominicOram opened this issue Aug 17, 2023 · 1 comment · May be fixed by #311
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@DominicOram
Copy link
Contributor

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

@DominicOram DominicOram changed the title Unclear error message when no plan exists Unclear error message when plan does not exists Aug 17, 2023
@callumforrester
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
2 participants