brew.rb: restore old runtime error handling.

We don't want to print the report/do not report messages for these.
This commit is contained in:
Mike McQuaid 2024-04-04 08:51:27 +01:00
parent 96878e869d
commit 3fe5cad8dd
No known key found for this signature in database

View File

@ -172,17 +172,18 @@ rescue BuildError => e
end end
exit 1 exit 1
rescue Exception => e # rubocop:disable Lint/RescueException rescue RuntimeError, SystemCallError => e
runtime_or_system_call_error = e.is_a?(RuntimeError) || e.is_a?(SystemCallError) raise if e.message.empty?
raise if runtime_or_system_call_error && 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 onoe e
method_deprecated_error = e.is_a?(MethodDeprecatedError) method_deprecated_error = e.is_a?(MethodDeprecatedError)
runtime_or_system_call_or_method_deprecated_error = runtime_or_system_call_error || method_deprecated_error $stderr.puts Utils::Backtrace.clean(e) if args&.debug? || ARGV.include?("--debug") || !method_deprecated_error
if args&.debug? || ARGV.include?("--debug") || !runtime_or_system_call_or_method_deprecated_error
$stderr.puts Utils::Backtrace.clean(e)
end
if OS.unsupported_configuration? if OS.unsupported_configuration?
$stderr.puts "#{Tty.bold}Do not report this issue: you are running in an unsupported configuration.#{Tty.reset}" $stderr.puts "#{Tty.bold}Do not report this issue: you are running in an unsupported configuration.#{Tty.reset}"