From d9579b195f3170bf0686da7fda4139c0ca2c04d4 Mon Sep 17 00:00:00 2001 From: androidseb Date: Wed, 11 Mar 2020 10:59:01 -0400 Subject: [PATCH] Fixing empty track use case The Google Play API returns a different error message body now, and the value of "e.to_s" is now something like this: "notFound: Track not found: alpha". I don't know if the "trackEmpty" case still applies, but I left it there in case. !!! Please verify and test this before merging !!! I have not tested this myself and this is just how I assume it should be fixed, maybe it's something completely different. This is meant to fix a bug that is now happening: the "google_play_track_version_codes" lane will error out if querying for the version codes list of an empty track. --- supply/lib/supply/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply/lib/supply/client.rb b/supply/lib/supply/client.rb index d8306581619..79386a41237 100644 --- a/supply/lib/supply/client.rb +++ b/supply/lib/supply/client.rb @@ -405,7 +405,7 @@ def track_version_codes(track) ) return result.releases.flat_map(&:version_codes) || [] rescue Google::Apis::ClientError => e - return [] if e.status_code == 404 && e.to_s.include?("trackEmpty") + return [] if e.status_code == 404 && (e.to_s.include?("trackEmpty") || e.to_s.include?("Track not found")) raise end end