class Sinatra::Base

def error(codes=Exception, &block)

handled.
class, or an HTTP status code to specify which errors should be
Define a custom error handler. Optionally takes either an Exception
def error(codes=Exception, &block)
  Array(codes).each { |code| @errors[code] = block }
end