voxpupuli / json-schema

Ruby JSON Schema Validator
MIT License
1.53k stars 242 forks source link

Attach URI to Read Error #313

Closed benfalk closed 7 years ago

benfalk commented 8 years ago

When getting a 404 or 500 error it was impossible to know which file was causing the problem with a schema that had many external references. This attaches the uri that failed to the error if it's an OpenURI error, which makes is easy to know what refrenced file was the culprit.

iainbeeston commented 8 years ago

Can you add some tests around this? (It should be easy to do, given an invalid uri)

benfalk commented 8 years ago

Thanks for the feedback @iainbeeston ! I'll work on these :smile:

benfalk commented 8 years ago

@iainbeeston I have made some edits, let me know what you think

iainbeeston commented 8 years ago

Yeah that's looking good. Just another couple of changes. Would also be good to get @RST-J to check this too before we merge

benfalk commented 8 years ago

@iainbeeston I've re-formatted the errors around a bit, let me know what you think. Thanks!

RST-J commented 8 years ago

I added my feedback - just minor things, in general I like this improvement. I can imagine that errors like this are currently not much fun during development.

iainbeeston commented 8 years ago

Hey @benfalk do you have time to implement the few points of feedback?

benfalk commented 8 years ago

@iainbeeston yup, sorry for dropping off on this. Been using my fork and this fell off on my radar. I'll get this updated a little later today.

iainbeeston commented 8 years ago

Hey @benfalk - just want to poke you over this, I'd love to merge your PR

iainbeeston commented 8 years ago

Or let me know if you're happy for me to fix it and merge it myself (I'm happy either way)

iainbeeston commented 7 years ago

I've fixed up the last few things and merged manually in 3f07ef0599c9a0e080840bfd1be04df433b7bbff

iainbeeston commented 7 years ago

Thanks @benfalk