From 3fe5cad8dd94ed1620870ea2ed6c82f34da82d6e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 4 Apr 2024 08:51:27 +0100 Subject: [PATCH] brew.rb: restore old runtime error handling. We don't want to print the report/do not report messages for these. --- Library/Homebrew/brew.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index 06e3bccecc..5f664ddc45 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -172,17 +172,18 @@ rescue BuildError => e end exit 1 -rescue Exception => e # rubocop:disable Lint/RescueException - runtime_or_system_call_error = e.is_a?(RuntimeError) || e.is_a?(SystemCallError) - raise if runtime_or_system_call_error && e.message.empty? +rescue RuntimeError, SystemCallError => e + raise if e.message.empty? + onoe e + $stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug") + + exit 1 +rescue Exception => e # rubocop:disable Lint/RescueException onoe e method_deprecated_error = e.is_a?(MethodDeprecatedError) - runtime_or_system_call_or_method_deprecated_error = runtime_or_system_call_error || method_deprecated_error - if args&.debug? || ARGV.include?("--debug") || !runtime_or_system_call_or_method_deprecated_error - $stderr.puts Utils::Backtrace.clean(e) - end + $stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug") || !method_deprecated_error if OS.unsupported_configuration? $stderr.puts "#{Tty.bold}Do not report this issue: you are running in an unsupported configuration.#{Tty.reset}"