Closed rngtng closed 8 years ago
related: https://github.com/aserafin/grape_logging/pull/10 (but doesn't actually solve the issue)
Do you have an idea on how to solve this ? I'm working on this problem in my fork.
well just check on the value of response
;
a dirty hack would be:
response.try(:status)
or better
status: (response.nil? ? nil : response.status) # or 'error' instead of nil
Ok thanks. It's done in my PR #16
@rngtng should be fixed since I merged #16
As of https://github.com/ruby-grape/grape/pull/1240 the
#after
hook is called on even when exception is raised. This breaks grape_logging which assumesresponse
, (@app_response
) to be set see: https://github.com/aserafin/grape_logging/blob/master/lib/grape_logging/middleware/request_logger.rb#L36See https://github.com/ruby-grape/grape/issues/1265 for discussion