def rescue_http_error(exception)
      # we need to call it before we assign the variables
      body = self.render_http_error(exception)
      [exception.status, exception.headers, body]
    end
def rescue_http_error(exception)
      # we need to call it before we assign the variables
      body = self.render_http_error(exception)
      [exception.status, exception.headers, body]
    end
redefine this method for your controller if you want to provide custom error pages
 returns response array for rack
 if you need to change just body of error message, define render_http_error method
 @api plugin