module Sinatra::Helpers

def error(code, body=nil)

Halt processing and return the error status provided.
def error(code, body=nil)
  code, body    = 500, code.to_str if code.respond_to? :to_str
  response.body = body unless body.nil?
  halt code
end