diff --git a/src/kemal/helpers/exceptions.cr b/src/kemal/helpers/exceptions.cr index a463cba..cda5e59 100644 --- a/src/kemal/helpers/exceptions.cr +++ b/src/kemal/helpers/exceptions.cr @@ -13,9 +13,9 @@ module Kemal::Exceptions end class CustomException < Exception - def initialize(context : HTTP::Server::Context, message : String = "") - @context = context - @message = message + def initialize(@context : HTTP::Server::Context, message : String? = nil) + message ||= "Rendered error with #{context.response.status_code}" + super message end end end