lib/nimbu-api/errors/service_error.rb in nimbu-api-0.4.0 vs lib/nimbu-api/errors/service_error.rb in nimbu-api-0.4.1
- old
+ new
@@ -1,19 +1,23 @@
# encoding: utf-8
# require 'multi_json'
-require 'nimbu-api/utils/json'
+require 'nimbu-api/utils/json'
module Nimbu
# Raised when Nimbu returns any of the HTTP status codes
module Error
class ServiceError < NimbuError
include ::Nimbu::Utils::Json
attr_reader :http_headers
attr_reader :http_body
+ attr_reader :status
+
def initialize(response)
@http_headers = response[:response_headers]
+ @status = response[:status]
+
message = parse_response(response)
super(message)
end
def parse_response(response)