diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/command_manager.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb index 03cdd6a4bb..e421f89884 100644 --- a/lib/rubygems/command_manager.rb +++ b/lib/rubygems/command_manager.rb @@ -148,7 +148,12 @@ class Gem::CommandManager def run(args, build_args=nil) process_args(args, build_args) rescue StandardError, Timeout::Error => ex - alert_error clean_text("While executing gem ... (#{ex.class})\n #{ex}") + if ex.respond_to?(:detailed_message) + msg = ex.detailed_message(highlight: false).sub(/\A(.*?)(?: \(.+?\))/) { $1 } + else + msg = ex.message + end + alert_error clean_text("While executing gem ... (#{ex.class})\n #{msg}") ui.backtrace ex terminate_interaction(1) |