module Roda::RodaPlugins::SinatraHelpers::RequestMethods

def error(code=500, body = nil)

and use a 500 status code.
If a single argument is given and it is not an integer, consider it the body
optional body.
Halt processing and return the error status provided with the given code and
def error(code=500, body = nil)
  unless code.is_a?(Integer)
    body = code
    code = 500
  end
  response.status = code
  response.body = body if body
  halt
end