Error Surfacing#1091
Conversation
| return code_response(ctrl, ctrl.play_media(media)) | ||
|
|
||
|
|
||
| @api.patch("/api/alert/hide") |
There was a problem hiding this comment.
This pathing might need some work. It made more sense when I had multiple alert endpoints being added here but I found 2/3 of the endpoints didn't make sense as I kept devving on this
There was a problem hiding this comment.
The MUI alert component that we use has a "severity" property that has 4 possible values - error, success, warning, and info. I have had no particular use for warning and info thus far, so I flattened it into just success or error. Within that, I generally only needed error so I had it be a store_true arg for whether it shows success or fail, I've upgraded that with full granularity to future proof these changes.
Luckily the other two AlertBar style components we use don't have the same controls so I didn't need to upkeep those for full feature parity in this PR
260a293 to
40f934b
Compare
| assert 'example' in req_spec or 'examples' in req_spec, f'{path_desc}: At least one example request required' | ||
| if 'examples' in req_spec: | ||
| assert len(req_spec['examples']) > 0, f'{path_desc}: At least one example request required' | ||
| except KeyError: | ||
| pass # request could be different type or non-existent | ||
| try: | ||
| resp_spec = m['responses']['200']['content']['application/json'] | ||
| assert 'example' in resp_spec or 'examples' in resp_spec, f'{path_desc}: At least one exmaple response required' | ||
| if 'exmaples' in resp_spec: | ||
| assert len(resp_spec['examples']) > 0, f'{path_desc}: At least one exmaple response required' | ||
| assert 'example' in resp_spec or 'examples' in resp_spec, f'{path_desc}: At least one example response required' | ||
| if 'examples' in resp_spec: | ||
| assert len(resp_spec['examples']) > 0, f'{path_desc}: At least one example response required' | ||
| except KeyError: | ||
| pass # reposnse could not be json | ||
| pass # response could not be json |
There was a problem hiding this comment.
This got hit by a spellcheck, I don't think that anything has been hurt by this (certainly nothing that's covered by tests) but given the consistency of the exmaple spelling, particularly in functional code as string comparisons, I wonder if that was intentional
8015464 to
aa4c2ba
Compare
40f934b to
5e4d99a
Compare
Correct spelling error Add initial form of global alert workflow
5e4d99a to
35f8495
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## VersionWarning #1091 +/- ##
=================================================
Coverage ? 50.73%
=================================================
Files ? 41
Lines ? 7478
Branches ? 0
=================================================
Hits ? 3794
Misses ? 3684
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What does this change intend to accomplish?
Surface backend errors to users better
Also mitigate some minor issues that required surfacing
Checklist
./scripts/test