mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-03-25 08:55:47 +00:00
Code style
This commit is contained in:
parent
585cd29a7d
commit
f35dc1e9d6
1 changed files with 7 additions and 9 deletions
|
|
@ -56,16 +56,14 @@ module GrapeLogging
|
||||||
|
|
||||||
# Catch error
|
# Catch error
|
||||||
error = catch(:error) do
|
error = catch(:error) do
|
||||||
begin
|
@app_response = @app.call(@env)
|
||||||
@app_response = @app.call(@env)
|
|
||||||
rescue => e
|
|
||||||
# Log as 500 + message
|
|
||||||
after(e.respond_to?(:status) ? e.status : 500, e.message)
|
|
||||||
|
|
||||||
# Re-raise exception
|
|
||||||
raise e
|
|
||||||
end
|
|
||||||
nil
|
nil
|
||||||
|
rescue StandardError => e
|
||||||
|
# Log as 500 + message
|
||||||
|
after(e.respond_to?(:status) ? e.status : 500, e.message)
|
||||||
|
|
||||||
|
# Re-raise exception
|
||||||
|
raise e
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get status & response from app_response
|
# Get status & response from app_response
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue