Fix recent changes to CustomException (#673)

This commit is contained in:
Sijawusz Pur Rahnama 2024-02-14 11:33:05 +01:00 committed by GitHub
parent bef7351000
commit 7c47bbc150
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,9 +13,9 @@ module Kemal::Exceptions
end end
class CustomException < Exception class CustomException < Exception
def initialize(context : HTTP::Server::Context, message : String = "") def initialize(@context : HTTP::Server::Context, message : String? = nil)
@context = context message ||= "Rendered error with #{context.response.status_code}"
@message = message super message
end end
end end
end end