lib/chatwork/chatwork_error.rb in chatwork-0.3.0 vs lib/chatwork/chatwork_error.rb in chatwork-0.3.1
- old
+ new
@@ -14,11 +14,11 @@
end
unless hash['errors']
return APIConnectionError.new("Invalid response #{body}")
end
- APIError.new(status, hash["errors"])
+ APIError.new(status, hash['errors'])
end
attr_reader :status
attr_reader :error_response
@@ -42,11 +42,11 @@
end
class APIError < ChatWorkError
attr_reader :errors
- def initilize(message, error_response)
- @errors = error_response["errors"]
- super(error_response["message"], status, error_response)
+ def initialize(status, error_response)
+ @errors = error_response
+ super(error_response[0], status, error_response)
end
end
end