handle json parser errors

This commit is contained in:
Dominik Richter 2015-12-07 14:39:56 +01:00 committed by Stephan Renatus
parent ae4420a736
commit ef487e3753

View file

@ -157,6 +157,9 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
end
JSON.load(config)
rescue JSON::ParserError => e
puts "Failed to load JSON configuration: #{e}\nConfig was: #{config.inspect}"
exit 1
end
end
InspecCLI.start(ARGV)