There's some very similar code in the compile error inspectors, maybe we should make a stack trace wrapper class that handles this and reuse it. https://github.com/opscode/chef/blob/master/lib/chef/formatters/error_inspectors/compile_error_inspector.rb