Skip to content

Commit

Permalink
improved error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamkrishnar committed Oct 30, 2022
1 parent 05ad827 commit 05e9e76
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/blog-post-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,17 @@ Promise.allSettled(promiseArray).then((results) => {
jobFailFlag = true;
// Rejected
core.error(runnerNameArray[index] + ' runner failed, please verify the configuration. Error:');
core.error(result.reason);
if (result.reason.message.startsWith('Status code')) {
const code = result.reason.message.replace('Status code ', '');
core.error(`Looks like your website returned ${code}, There is nothing blog post workflow` +
` can do to fix it. Please check your website's RSS feed generation source code. Also double check the URL.`);
if (code === `503`) {
core.error(`If you are using Cloudflare or Akamai, make sure that you have the user agent ` +
` ${userAgent} or GitHub actions IP ranges whitelisted in your firewall.`);
}
} else {
core.error(result.reason.message);
}
}
});
}).finally(async () => {
Expand Down

0 comments on commit 05e9e76

Please sign in to comment.