-
Notifications
You must be signed in to change notification settings - Fork 12
Report an error if schema isn't loaded #186
Comments
Fix of error where uploading an invalid .json schema (empty or corrupted) from local filestore did not trigger an invalid JSON warning.
I'll be taking invalid regex |
change error message for schema error, currently prints "Sorry, your CSV did not pass validation. Please review the errors and warnings below:" |
lines 26 - 34 of Validation currently always eval false, would be worthwhile working out what condition they were intended to catch
|
@quadrophobiac you mean both of these conditions always fail? The first looks like it's intended to handle uploaded files, and the second ... not sure. Will look at the context.... |
@quadrophobiac do you mean this section? https://github.com/theodi/csvlint/blob/master/app/models/validation.rb#L19 The line numbers seems different... |
Yes apologies - I was referring to the line numbers on the error-reporting-schema_expanded-test-suite branch |
I've confirmed non triggering by running the tests suite with a byebug in each conditional |
Ah, I looked on the fix-schema branch but not the other - my bad. Looking closer now. |
Started a pull request on invalid regex functionality: Data-Liberation-Front/csvlint.rb#132 |
Data-Liberation-Front/csvlint.rb#132 is good to go - so we need to make sure the newly created errors are shown this end |
If a user supplies a schema and we fail to load it, then the application should report an error so its clear that the schema hasn't been applied.
Currently it falls back to not applying any schema validation which is misleading.
As a first step, reporting a basic error would be an immediate improvement.
Reporting why the schema is invalid would also be useful, although there are a range of possible errors:
The first two are definitely fatal errors. The last two are potentially just warnings. Depends if we want to work on a "best effort" basis.
The text was updated successfully, but these errors were encountered: