From e63ddf9c005ea90d172e2fbfe941abd11b1cd6f9 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Sun, 12 Sep 2021 12:28:04 -0600 Subject: [PATCH] Avoid warning for cache reservation errors We have no way of knowing if another build has already cached these artifacts, so CacheReservationError is expected. --- src/cache-gradle-user-home.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cache-gradle-user-home.ts b/src/cache-gradle-user-home.ts index e81af97..f531eb9 100644 --- a/src/cache-gradle-user-home.ts +++ b/src/cache-gradle-user-home.ts @@ -135,9 +135,12 @@ export class GradleUserHomeCache extends AbstractCache { !(error instanceof Error) ) { throw error + } else if (error instanceof cache.ReserveCacheError) { + // These are expected if the artifact is already cached + this.debug(error.message) + } else { + core.warning(error.message) } - // TODO : Avoid warning for reserve cache error: this is expected - core.warning(error.message) } // Write the marker file that will stand in place of the original