lib/spire/router.rb in spire-0.4.8 vs lib/spire/router.rb in spire-0.4.9
- old
+ new
@@ -36,11 +36,11 @@
end
end
end
if !@app["controller"]
- return Error.new :message => "Route not found in system/routes.rb", :status => 404
+ return Error.return_error :message => "Route not found in system/routes.rb", :status => 404
end
return self.run
end
@@ -50,11 +50,11 @@
result = @class.method(@app["action"]).call
buffer = @class.get_buffer
if !buffer && !result
- return Error.new :message => "No method/Response from method. See #{@app["controller"]}##{@app["action"]} and check for a response", :status => 404
+ return Error.return_error :message => "No method/Response from method. See #{@app["controller"]}##{@app["action"]} and check for a response", :status => 404
end
content_type = "text/html;"
status = 200
@@ -63,11 +63,11 @@
end
if @class.instance_variable_get(:@content_type)
content_type = @class.instance_variable_get(:content_type)
end
-
+
if result
buffer = buffer + result
end
return Response.new(buffer, content_type, status)
@@ -79,10 +79,10 @@
puts response
if response
response.to_rack
else
- Error.new :status => 444
+ Error.return_error :status => 444
end
end
end
end