Skip to content

Commit 48f80a6

Browse files
committed
guard against any error in stderr logging
io errors, re-assigment
1 parent 8d9149c commit 48f80a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sentry-ruby/lib/sentry/utils/logging_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def sdk_logger
3535
# @!visibility private
3636
def log_to_stderr(error, message)
3737
$stderr.puts("Sentry SDK logging failed (#{error.class}: #{error.message}): #{message}".scrub(%q(<?>)))
38+
rescue StandardError
39+
# swallow everything – logging must never crash the app
3840
end
3941
end
4042
end

0 commit comments

Comments
 (0)