Skip to content

Commit

Permalink
Don't log any error details.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 13, 2023
1 parent 41ae54d commit 81108f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/rack/error_handler.rb
Expand Up @@ -19,11 +19,11 @@ def log_error(env, error)
end

def bad_request(error)
[400, {}, ["Bad Request: #{error.class}"]]
[400, {}, ["Bad Request"]]
end

def internal_server_error(error)
[500, {}, ["Internal Server Error: #{error.class}"]]
[500, {}, ["Internal Server Error"]]
end

def call(env)
Expand Down
4 changes: 2 additions & 2 deletions test/spec_error_handler.rb
Expand Up @@ -23,7 +23,7 @@
response = middleware.call(Rack::MockRequest.env_for("/"))

response[0].must_equal 400
response[2].to_ary.must_equal ["Bad Request: #{error}"]
response[2].to_ary.must_equal ["Bad Request"]
end

it "catches standard errors as 500 Internal Server Error" do
Expand All @@ -37,7 +37,7 @@
response = middleware.call(Rack::MockRequest.env_for("/"))

response[0].must_equal 500
response[2].to_ary.must_equal ["Internal Server Error: #{error}"]
response[2].to_ary.must_equal ["Internal Server Error"]
end

it "logs errors to the rack.errors stream" do
Expand Down

0 comments on commit 81108f4

Please sign in to comment.