Add message support to Kemal::Exceptions::CustomException (#671)

This commit is contained in:
Serdar Dogruyol - Sedo セド 2024-02-01 12:50:40 +03:00 committed by GitHub
parent 9628043e4c
commit bb9105f202
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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