openownership / lib-cove-bods

Check that your data complies with the Beneficial Ownership Data Standard (BODS) using our install our data review library to analyse files via your command line interface
https://datareview.openownership.org/
Other
1 stars 0 forks source link

Improve error message when non-valid JSON encountered #110

Closed kd-ods closed 1 month ago

kd-ods commented 3 months ago

Issue description

When non-valid JSON is encountered, users get the unhelpful message:

image

Suggested resolution

If the tool doesn't already do a basic JSON validation test, then add that. Then if basic JSON validation fails, give the error message:

Error title: Data parsing error Error message: The data is not valid JSON. Use a JSON validator tool to correct your data.

It's still possible that valid JSON is supplied which cannot be parsed and handled as BODS. That type of error should also be caught and handled. With an error message like:

Error title: Data parsing error Error message: The data is valid JSON, but is not recognised as an array of BODS Statements."

kd-ods commented 3 months ago

OK to sneak this into the current sprint, @radix0000? It's such a basic and important usability issue.

kd-ods commented 3 months ago

I've realised that this might have to be dealt with in cove-bods, not here, but will leave you to move the issue if necessary, @radix0000.