Skip to content

Commit

Permalink
Rescue from TypeErrors when parsing schemas
Browse files Browse the repository at this point in the history
Trapping and binning this exception allowed me to actually use this
code in a real-world situation. Crucially (maybe), all the specs still
pass
  • Loading branch information
pikesley authored and pezholio committed Nov 10, 2016
1 parent b45ea6d commit 53bc3ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/csvlint/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def load_from_json(uri, output_errors = true)
else
return Schema.from_json_table(uri,json)
end
rescue TypeError => e
# NO IDEA what this was even trying to do - SP 20160526

rescue Csvlint::Csvw::MetadataError => e
raise e
rescue OpenURI::HTTPError, Errno::ENOENT => e
Expand Down

0 comments on commit 53bc3ce

Please sign in to comment.