crs4 / rocrate-validator

A Python package to validate RO-Crates
Apache License 2.0
7 stars 7 forks source link

Clearer error message when using the `ro-crate-metadata.json` rather than the crate directory as input #33

Closed elichad closed 3 weeks ago

elichad commented 3 weeks ago

We are using the validator at the ELIXIR BioHackathon (hence the influx of new issues!).

When someone uses the validator for the first time, they will usually use path/to/crate/ro-crate-metadata.json as input rather than just path/to/crate/. This gives an error about an invalid path which isn't clear how to resolve:

ROCrateInvalidURIError: Invalid URI "PosixPath('tests/data/crates/valid/workflow-roc/ro-crate-metadata.json')"

[ERROR] 

[FAILED] Unexpected error: Invalid URI "PosixPath('tests/data/crates/valid/workflow-roc/ro-crate-metadata.json')" !!!

There should be a clearer error message (and documentation!) explaining that the user should pass the whole directory as input, not the ro-crate-metadata.json.

ilveroluca commented 3 weeks ago

@elichad if the group of hackers collects some good notes as it uses the validator, those may be some good material for the documentation!