From 4de4e3d93b58d211de4f8006a9f10b3d257899f9 Mon Sep 17 00:00:00 2001 From: Vlad Faust Date: Thu, 23 Aug 2018 19:02:21 +0300 Subject: [PATCH] fix: `halt!` now throws internally --- src/prism/action.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/prism/action.cr b/src/prism/action.cr index d4c9ea0..c654ba1 100644 --- a/src/prism/action.cr +++ b/src/prism/action.cr @@ -42,6 +42,7 @@ module Prism # :nodoc: def call_with_callbacks with_callbacks { call } + rescue Halt end # Will **not** raise on exceed, defaults to 8 MB. @@ -106,7 +107,7 @@ module Prism json({{response}}) {% end %} - return false + raise Halt.new end # Set HTTP status code. @@ -182,6 +183,9 @@ module Prism json(value) end {% end %} + + private class Halt < Exception + end end end