From 7c47bbc15069a7ef70ae50db83a80714b6ec5ae7 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Wed, 14 Feb 2024 11:33:05 +0100 Subject: [PATCH] Fix recent changes to `CustomException` (#673) --- 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