Add message support to Kemal::Exceptions::CustomException

This commit is contained in:
Serdar Dogruyol 2024-02-01 12:11:32 +03:00
parent 9628043e4c
commit d9c77206a8

View file

@ -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