lib/hyperdrive/endpoint.rb in hyperdrive-0.0.7 vs lib/hyperdrive/endpoint.rb in hyperdrive-0.0.8

- old
+ new

@@ -42,16 +42,20 @@ case body when Array, Hash if json? MultiJson.dump(body) else - $stderr.puts "can't serialize response automatically" + env['rack.errors'] << "ENDPOINT: Can't serialize response automatically" end when String body else body.to_s end + end + + def self.error(status, message) + raise Errors::HTTPError.new(message, status) end def self.status case env['REQUEST_METHOD'] when 'POST'