class Honeybadger::Backend::Response
def initialize(*args)
-
message(String) -- The String message returned by the server (or -
body(String) -- The String body of the response. -
code(Integer) -- The status code. May also be :error for requests -
response(Net::HTTPResponse) -- With 1 argument, the code, body,
Overloads:
-
initialize(code, body, message) -
initialize(response)
def initialize(*args) if (response = args.first).kind_of?(Net::HTTPResponse) @code, @body, @message = response.code.to_i, response.body.to_s, response.message else @code, @body, @message = args end @success = (200..299).cover?(@code) @error = parse_error(body) unless @success end