Improve CLI error reporting

This commit is contained in:
Thibault Jouan
2014-10-11 17:34:19 +00:00
parent f6237bfc0c
commit 25d03d4322
8 changed files with 142 additions and 7 deletions

View File

@@ -17,8 +17,9 @@ module Producer
rescue ArgumentError => e
stderr.puts e.message
exit EX_USAGE
rescue RuntimeError => e
stderr.puts "#{e.class.name.split('::').last}: #{e.message}"
rescue Exception => e
ef = ErrorFormatter.new(force_cause: [RecipeEvaluationError])
stderr.puts ef.format e
exit EX_SOFTWARE
end
end