spaceship/lib/spaceship/tunes/tunes_client.rb in fastlane-2.115.0.beta.20190119200019 vs spaceship/lib/spaceship/tunes/tunes_client.rb in fastlane-2.115.0.beta.20190120200101

- old
+ new

@@ -161,19 +161,18 @@ def handle_itc_response(raw, flaky_api_call: false) return unless raw return unless raw.kind_of?(Hash) data = raw['data'] || raw # sometimes it's with data, sometimes it isn't - error_keys_to_check = [ - "sectionErrorKeys", - "sectionInfoKeys", - "sectionWarningKeys", - "validationErrors" - ] - errors_in_data = fetch_errors_in_data(data_section: data, keys: error_keys_to_check) - errors_in_version_info = fetch_errors_in_data(data_section: data, sub_section_name: "versionInfo", keys: error_keys_to_check) + error_keys = ["sectionErrorKeys", "validationErrors", "serviceErrors"] + info_keys = ["sectionInfoKeys", "sectionWarningKeys"] + error_and_info_keys_to_check = error_keys + info_keys + + errors_in_data = fetch_errors_in_data(data_section: data, keys: error_and_info_keys_to_check) + errors_in_version_info = fetch_errors_in_data(data_section: data, sub_section_name: "versionInfo", keys: error_and_info_keys_to_check) + # If we have any errors or "info" we need to treat them as warnings or errors if errors_in_data.count == 0 && errors_in_version_info.count == 0 logger.debug("Request was successful") end @@ -203,11 +202,10 @@ end errors = handle_response_hash.call(data) # Search at data level, as well as "versionInfo" level for errors - error_keys = ["sectionErrorKeys", "validationErrors"] errors_in_data = fetch_errors_in_data(data_section: data, keys: error_keys) errors_in_version_info = fetch_errors_in_data(data_section: data, sub_section_name: "versionInfo", keys: error_keys) errors += errors_in_data.values if errors_in_data.values errors += errors_in_version_info.values if errors_in_version_info.values @@ -232,10 +230,9 @@ raise ITunesConnectError.new, errors.join(' ') end end # Search at data level, as well as "versionInfo" level for info and warnings - info_keys = ["sectionInfoKeys", "sectionWarningKeys"] info_in_data = fetch_errors_in_data(data_section: data, keys: info_keys) info_in_version_info = fetch_errors_in_data(data_section: data, sub_section_name: "versionInfo", keys: info_keys) info_in_data.each do |info_key, info_value| puts(info_value)