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

Validator error messages for features that report 501 Not Implemented are misleading #946

Open
ml-evs opened this issue Sep 22, 2021 · 2 comments
Assignees
Labels
ergonomics Features that improve the usability of the package priority/medium Issue or PR with a consensus of medium priority validator Related to the OPTIMADE validator

Comments

@ml-evs
Copy link
Member

ml-evs commented Sep 22, 2021

Now that validation results are being displayed in the dashboard, some of the error messages could be made much more legible by removing the unnecessary tracebacks (as is already done implicitly for ValidationError), e.g.

This issue now refers to the misleading error message below. Currently the 501 response and its error detail are not being properly returned to the error-handling, so the messages are pretty useless.

✖: https://www.crystallography.net/cod/optimade/structures?filter=structure_features HAS "disorder" - _construct_queries_for_property - failed with error
	ResponseError: Unable to perform mandatory query 'structure_features HAS "disorder"', which raised the error: received expected response: <Response [501]>.
	Traceback (most recent call last):
	  File "/home/mevans/src/optimade/optimade-python-tools/optimade/validator/utils.py", line 318, in wrapper
	    raise exc
	  File "/home/mevans/src/optimade/optimade-python-tools/optimade/validator/utils.py", line 314, in wrapper
	    result, msg = test_fn(validator, *args, **kwargs)
	  File "/home/mevans/src/optimade/optimade-python-tools/optimade/validator/validator.py", line 652, in _construct_queries_for_property
	    return self._construct_single_property_filters(
	  File "/home/mevans/src/optimade/optimade-python-tools/optimade/validator/validator.py", line 801, in _construct_single_property_filters
	    raise ResponseError(
	optimade.validator.utils.ResponseError: Unable to perform mandatory query 'structure_features HAS "disorder"', which raised the error: received expected response: <Response [501]>.

Closed by #948.

@ml-evs ml-evs added priority/medium Issue or PR with a consensus of medium priority validator Related to the OPTIMADE validator ergonomics Features that improve the usability of the package labels Sep 22, 2021
@ml-evs ml-evs self-assigned this Sep 22, 2021
@CasperWA
Copy link
Member

I guess it still might be nice to include it for a higher verbosity? At least for the sake of developers to understand where in their code this error is originating from.

@ml-evs
Copy link
Member Author

ml-evs commented Sep 23, 2021

Yeah, turns out this is what we already have, we were just using a high verbosity in the dashboard... I've left this open just for the second part, but can amend the description above.

@ml-evs ml-evs changed the title Validator errors with tracebacks look very cluttered Validator error messages for features that report 501 Not Implemented are misleading Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ergonomics Features that improve the usability of the package priority/medium Issue or PR with a consensus of medium priority validator Related to the OPTIMADE validator
Projects
None yet
Development

No branches or pull requests

2 participants