Skip to content

Commit

Permalink
Handle sponsorship errors in index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
salahhusa9 committed Aug 2, 2024
1 parent 3301e62 commit fafd9e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand Down

0 comments on commit fafd9e6

Please sign in to comment.