IDLabResearch / TurtleValidator

A Turtle validator on command line and in browser
http://ttl.summerofcode.be
MIT License
45 stars 11 forks source link

exit with error code if errors #7

Closed maxlath closed 5 years ago

maxlath commented 5 years ago

I was expecting the following behavior

ttl my_ttl_file_with_errors.ttl && echo "success" || echo "failed"
# => failed

instead this is what happens

ttl my_ttl_file_with_errors.ttl && echo "success" || echo "failed"
# => success

the reason being that the process exit code is always 0: could there by a process.exit(1) in case an error was detected, either by default or with an option passed to the executable?

thanks for this great tool!

mielvds commented 5 years ago

sure, but with an option then, because error codes should be for malfunctioning programs, not documents :)

RubenVerborgh commented 5 years ago

I disagree, non-zero error code seems acceptable for invalid files. You can do, for instance, 1 for file not found and 2 for validation error.

mielvds commented 5 years ago

Okay, fixed in https://github.com/IDLabResearch/TurtleValidator/commit/b1df716e69daa7fb870a78b1abbf9f7999bce465