class Athena::Routing::Exceptions::AthenaException

Overview

A generic exception that can be thrown with to render consistent exception responses with the given code and message.

Direct Known Subclasses

Defined in:

routing/exceptions.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(code : Int32, message) #

[View source]

Instance Method Detail

def code : Int32 #

[View source]
def to_json : String #

Serializes the exception into a JSON object with the given code and message.

{
  "code":    409,
  "message": "A user with this email already exists.",
}

[View source]