Halcyon

Notice: The website is currently being udpated. Sorry for any inconvenience.

Exceptions

The most up-to-date list of HTTP status codes that Halcyon supports can be seen
at the GitHub source page
which is transformed into actual exception classes from the error message.

Here is a list of the actual Exception classes as created by this list and a
brief overview of when to use these exceptions:

Making Your Own

Although the standard exceptions available should be sufficient (they are
the HTTP response codes), you could certainly make up your own HTTP response
codes. Putting this inside of an init file or in the lib directory should
be fine:

 1 ## lib/custom_exception.rb
 2 ## or config/init/custom_exception.rb
 3 class CustomException < Halcyon::Exceptions::Base
 4   
 5   def initialize(body = 'Custom Exception')
 6     super(460, body)
 7   end
 8   
 9 end

As you can see, the status code is the first argument to the base initialize
method and the body variable is set to the default error text. Obviously, the
exception name, file name, and error status should be more descriptive.
Pick a sane error code as well, something that hasn’t been used officially.

If at all possible, use the default response codes/exceptions.