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

Improve error message when submitting a process #41

Open
sphuber opened this issue Nov 10, 2022 · 2 comments
Open

Improve error message when submitting a process #41

sphuber opened this issue Nov 10, 2022 · 2 comments
Labels
graphQL Related to graphQL API

Comments

@sphuber
Copy link
Contributor

sphuber commented Nov 10, 2022

Currently when submitting a process and the inputs are incorrect (for example label is missing, which shouldn't really even be required), the error message is not very useful.
We simply get a

422 Unprocessable Entity
{'detail': [{'loc': ['body', 'label'], 'msg': 'field required', 'type': 'value_error.missing'}]}

It should ideally tell what data is missing.

@ltalirz ltalirz added the graphQL Related to graphQL API label Nov 11, 2022
@sphuber
Copy link
Contributor Author

sphuber commented Nov 14, 2022

Turns out that the information is in the response, just hidden. In the example mentioned above, the label was missing. But maybe we can extract this from response['detail'][0]['loc'][-1] but not sure how fixed the format of this response is.

@ltalirz
Copy link
Member

ltalirz commented Nov 14, 2022

maybe a more generic printing of the detail field could do the trick?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graphQL Related to graphQL API
Projects
None yet
Development

No branches or pull requests

2 participants