diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-02-22 21:09:42 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-02-22 21:09:42 -0600 |
commit | a956ebe4c86757441f6767b9e6eb5e728f040f36 (patch) | |
tree | 2acb5b6fb13c53d71d7dc8353979b37d1add45f3 /lib | |
parent | 3b5fb4ed22e1c0bf2da07ff5db645c245720de3c (diff) | |
download | bundler-a956ebe4c86757441f6767b9e6eb5e728f040f36.tar.gz |
[Exec] Filter bundler code from backtrace when load fails
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli/exec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb index 7359f998..095b7b79 100644 --- a/lib/bundler/cli/exec.rb +++ b/lib/bundler/cli/exec.rb @@ -66,7 +66,8 @@ module Bundler rescue Exception => e # rubocop:disable Lint/RescueException Bundler.ui = ui Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})" - abort "#{e.class}: #{e.message}\n#{e.backtrace.join("\n ")}" + backtrace = e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) } + abort "#{e.class}: #{e.message}\n #{backtrace.join("\n ")}" end def ruby_shebang?(file) |