diff --git a/src/grip/handlers/exception.cr b/src/grip/handlers/exception.cr index 5e56a25..bbdf5d8 100644 --- a/src/grip/handlers/exception.cr +++ b/src/grip/handlers/exception.cr @@ -13,6 +13,8 @@ module Grip def call(context : HTTP::Server::Context) call_next(context) rescue ex + return context if context.response.closed? + context.response.status_code = 500 if !context.response.status_code.in?([400, 401, 403, 404, 405, 500]) if ex.is_a?(Grip::Exceptions::Base)