-
Notifications
You must be signed in to change notification settings - Fork 6
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
improve error messages when running plan without parameters #385
improve error messages when running plan without parameters #385
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #385 +/- ##
==========================================
- Coverage 89.38% 89.04% -0.35%
==========================================
Files 43 43
Lines 1800 1817 +17
==========================================
+ Hits 1609 1618 +9
- Misses 191 199 +8 ☔ View full report in Codecov by Sentry. |
one error in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested actually using it yet but will aim to tomorrow.
Two of the tests are currently failing though, is this expected?
re: failing tests - that's due to the now changed order and complexity of requests. one way is to change the mockrequests. |
9b9237f
to
2f15f16
Compare
fwiw the REST part of CLI has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been quite a while since the issue was opened and things have changed quite a bit now.
The approach used looks reasonable, and does prevent the very nasty server/pool errors, however running blueapi controller run scan
with this PR gives:
Traceback (most recent call last):
File "/scratch/30day_tmp/delete24apr/blueapi/venv/bin/blueapi", line 8, in <module>
sys.exit(main())
^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/venv/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/venv/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/venv/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/venv/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/venv/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/venv/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/src/blueapi/cli/cli.py", line 108, in wrapper
func(*args, **kwargs)
File "/scratch/30day_tmp/delete24apr/blueapi/venv/lib/python3.11/site-packages/click/decorators.py", line 38, in new_func
return f(get_current_context().obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/30day_tmp/delete24apr/blueapi/src/blueapi/cli/cli.py", line 188, in run_plan
task = Task(name=name, params=parsed_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Task
params
value is not a valid dict (type=type_error.dict)
which doesn't seem to be an improvement over the original error reported in the issue.
in the CLI file we don't have access to the raw http response as that's in the |
that is a too optmistic a function, does not provide natural thin error handling from the http to cli layer |
suggested plan of action - hard code the request into this specific cli command - without using the |
@stan-dot You can do what you like within the |
the thing is that right now we can throw the error, but then the function does not return normally. one alternative is to change the return tpe from 'T' to NOTE: if auto-client gen succeeds then this is a moot question |
that's a better serverside message but we don't want a 5** message but a 4** one. on it
is the behavior |
suggestion: do client autogen issue first #364 |
2fd7b7e
to
e8fd356
Compare
doing this fresh in #206 issue |
closes #206