From c841d299a2c955c9a01831180f5937a7926431c8 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Fri, 9 Feb 2024 01:17:47 +0100 Subject: [PATCH] Fix recent changes to `CustomException` --- src/kemal/helpers/exceptions.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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