diff --git a/Library/Homebrew/cask/upgrade.rb b/Library/Homebrew/cask/upgrade.rb index 6e350d96f9..0e5e1870c1 100644 --- a/Library/Homebrew/cask/upgrade.rb +++ b/Library/Homebrew/cask/upgrade.rb @@ -118,7 +118,9 @@ module Cask quarantine: quarantine, require_sha: require_sha ) rescue => e - caught_exceptions << e.exception("#{new_cask.full_name}: #{e}") + new_exception = e.exception("#{new_cask.full_name}: #{e}") + new_exception.set_backtrace(e.backtrace) + caught_exceptions << new_exception next end