lib/grape/error_formatter/base.rb in grape-0.10.1 vs lib/grape/error_formatter/base.rb in grape-0.11.0
- old
+ new
@@ -39,10 +39,10 @@
# env['api.endpoint'].route does not work when the error occurs within a middleware
# the Endpoint does not have a valid env at this moment
http_codes = env['rack.routing_args'][:route_info].route_http_codes || []
found_code = http_codes.find do |http_code|
(http_code[0].to_i == env['api.endpoint'].status) && http_code[2].respond_to?(:represent)
- end
+ end if env['api.endpoint'].request
presenter = found_code[2] if found_code
end
if presenter