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,17 +56,15 @@ module GrapeLogging
|
|||
|
||||
# Catch error
|
||||
error = catch(:error) do
|
||||
begin
|
||||
@app_response = @app.call(@env)
|
||||
rescue => e
|
||||
nil
|
||||
rescue StandardError => e
|
||||
# Log as 500 + message
|
||||
after(e.respond_to?(:status) ? e.status : 500, e.message)
|
||||
|
||||
# Re-raise exception
|
||||
raise e
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
||||
# Get status & response from app_response
|
||||
# when no error occurs.
|
||||
|
|
|
|||
Loading…
Reference in a new issue