From bb9105f202df3cfa87197f71dce0dd20194c1bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20Dogruyol=20-=20Sedo=20=E3=82=BB=E3=83=89?= <990485+sdogruyol@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:50:40 +0300 Subject: [PATCH] Add message support to Kemal::Exceptions::CustomException (#671) --- src/kemal/helpers/exceptions.cr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kemal/helpers/exceptions.cr b/src/kemal/helpers/exceptions.cr index 53520b3..666cdd9 100644 --- a/src/kemal/helpers/exceptions.cr +++ b/src/kemal/helpers/exceptions.cr @@ -13,7 +13,10 @@ module Kemal::Exceptions end class CustomException < Exception - def initialize(context : HTTP::Server::Context) + def initialize(context : HTTP::Server::Context, message : String = "") + @context = context + @message = message + super "Rendered error with #{context.response.status_code}" end end