Skip to content

Commit

Permalink
Less safe log error (but aligns with the requirements of the spec).
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 13, 2023
1 parent e37b8f7 commit 41ae54d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/rack/error_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ def initialize(app)
end

def log_error(env, error)
if error_stream = env[RACK_ERRORS]
# Exception#full_message was introduced in Ruby 2.5+. If it's not
# available, we fall back to the old behavior of just printing the
# exception message.
if error.respond_to?(:full_message)
error_stream.puts(error.full_message)
else
error_stream.puts(error.message)
end
error_stream = env[RACK_ERRORS]
# Exception#full_message was introduced in Ruby 2.5+. If it's not
# available, we fall back to the old behavior of just printing the
# exception message.
if error.respond_to?(:full_message)
error_stream.puts(error.full_message)
else
error_stream.puts(error.message)
end
end

Expand Down

0 comments on commit 41ae54d

Please sign in to comment.