summaryrefslogtreecommitdiff
path: root/lib/bundler/friendly_errors.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-06-25 21:40:34 +0200
committergit <svn-admin@ruby-lang.org>2022-06-27 23:35:45 +0900
commitf9f85a513b9b6580dcff03872391cf387d0105b5 (patch)
treedfb7c6845a69098fca8ca0ac3c47e791e8149fc3 /lib/bundler/friendly_errors.rb
parent8c6c3e30f3a86ba0b697a0d99efe8ff4585c4a42 (diff)
[rubygems/rubygems] Print error messages just once in verbose mode
When running a command with the `--verbose` flag that ends up raising a `BundlerError`, Bundler will unnecessarily print the error twice. This commit fixes the issue by removing the duplicate logging. https://github.com/rubygems/rubygems/commit/689004a164
Diffstat (limited to 'lib/bundler/friendly_errors.rb')
-rw-r--r--lib/bundler/friendly_errors.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index ff6cdc4123..d0d2a6679a 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -29,8 +29,11 @@ module Bundler
Bundler.ui.error error.message
Bundler.ui.trace error.orig_exception
when BundlerError
- Bundler.ui.error error.message, :wrap => true
- Bundler.ui.trace error
+ if Bundler.ui.debug?
+ Bundler.ui.trace error
+ else
+ Bundler.ui.error error.message, :wrap => true
+ end
when Thor::Error
Bundler.ui.error error.message
when LoadError