Skip to content

Commit fafd9e6

Browse files
committed
Handle sponsorship errors in index.js
1 parent 3301e62 commit fafd9e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ async function run() {
3838

3939
console.log('thanks for sponsoring us :)');
4040
} catch (error) {
41-
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]");
41+
if (error.response && error.response.status === 403) {
42+
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]");
43+
} else if (error.response && error.response.status === 500) {
44+
console.error("An error occurred while checking sponsorship, but the deployment will continue.");
45+
} else {
46+
throw error;
47+
}
4248
}
4349

4450
console.log("Connecting to the server...");

0 commit comments

Comments
 (0)