From fafd9e688237afd42d2954d26643476dddbe0cea Mon Sep 17 00:00:00 2001 From: salah eddine bendyab Date: Fri, 2 Aug 2024 11:24:12 +0100 Subject: [PATCH] Handle sponsorship errors in index.js --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index eed037d..dd5608b 100644 --- a/index.js +++ b/index.js @@ -38,7 +38,13 @@ async function run() { console.log('thanks for sponsoring us :)'); } catch (error) { - throw new Error("You are not a sponsor, Please consider sponsoring us to use this action, https://github.com/sponsors/DeployRepository , Start sponsoring us and try again [1$ or more]"); + if (error.response && error.response.status === 403) { + throw new Error("You are not a sponsor, Please consider sponsoring us to use this action, https://github.com/sponsors/DeployRepository , Start sponsoring us and try again [1$ or more]"); + } else if (error.response && error.response.status === 500) { + console.error("An error occurred while checking sponsorship, but the deployment will continue."); + } else { + throw error; + } } console.log("Connecting to the server...");