lib/zoho_hub/response.rb in zoho_hub-0.1.56 vs lib/zoho_hub/response.rb in zoho_hub-0.2.0

- old
+ new

@@ -5,13 +5,11 @@ def initialize(params) @params = params || {} end def invalid_data? - if data.is_a?(Array) - return data.first[:code] == 'MANDATORY_NOT_FOUND' - end + return false if data.is_a?(Array) data[:code] == 'INVALID_DATA' end # {:code=>"INVALID_TOKEN", :details=>{}, :message=>"invalid oauth token", :status=>"error"} @@ -40,10 +38,9 @@ data end def msg msg = data[:message] - msg << ", error in #{data.dig(:details, :api_name)}" if data.dig(:code) == 'INVALID_DATA' if data.dig(:details, :expected_data_type) expected = data.dig(:details, :expected_data_type) field = data.dig(:details, :api_name) parent_api_name = data.dig(:details, :parent_api_name)