Skip to content

Commit

Permalink
Add message support to Kemal::Exceptions::CustomException
Browse files Browse the repository at this point in the history
  • Loading branch information
sdogruyol committed Feb 1, 2024
1 parent 9628043 commit d9c7720
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/kemal/helpers/exceptions.cr
Expand Up @@ -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
Expand Down

0 comments on commit d9c7720

Please sign in to comment.