mirror of
https://github.com/inspec/inspec
synced 2024-09-22 15:32:02 +00:00
handle json parser errors
This commit is contained in:
parent
ae4420a736
commit
ef487e3753
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue