validate
validate copied to clipboard
Improve error handling for unresolved nested schemas
Describe the bug When using a catalog file, if a schema cannot be resolved, the error handling needs some improvement. For several cases, it throws erroneous or vague error messages.
To Reproduce CASE 1
- Remove
src/test/resources/github87/pds/v1/PDS4_PDS_1900.xsd
from your local version of validate - Try to run integration test
testGithub87
- Take a look at
target/test/report_github87_1.json
to see the bogus error message:
Begin Schema: http://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1900.xsd
ERROR [error.label.schema] line 1, 50: White spaces are required between publicId and systemId.
End Schema: http://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1900.xsd
CASE 2 See #116 . If the catalog resolver cannot resolve a nested schema properly, it only throws the error:
ERROR [error.label.schema] line 1, 1: Content is not allowed in prolog.
We should do some checks to see if it resolves, and if not, throw the proper error message.