Skip to content

Commit b9358e9

Browse files
hsbtclaude
authored andcommitted
[ruby/rubygems] Show only error message on attestation failure unless verbose
When auto-attestation fails, the warning previously included e.full_message with a full backtrace that could be noisy and expose local paths. Now only e.message is shown by default, and the full backtrace is included only when Gem.configuration.really_verbose is set. ruby/rubygems@4a4d9b8911 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8047213 commit b9358e9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/rubygems/commands/push_command.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ def send_push_request_with_attestation(name, args)
135135
request.add_field "Authorization", api_key
136136
end
137137
rescue StandardError => e
138-
alert_warning "Failed to push with attestation, retrying without attestation.\n#{e.full_message}"
138+
message = "Failed to push with attestation, retrying without attestation.\n"
139+
message += if Gem.configuration.really_verbose
140+
e.full_message
141+
else
142+
e.message
143+
end
144+
alert_warning message
139145
send_push_request_without_attestation(name, args)
140146
end
141147

0 commit comments

Comments
 (0)