Materials-Consortia / Materials-Consortia/optimade-python-tools

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

Open
#946 2 comments 0 reactions 1 assignee View on GitHub

@ml-evs is already working on this.

Since Sep 22, 2021.

ergonomics priority/medium validator
Dominant language
Python
Stars
91
Forks
54
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.