Skip to content

Commit

Permalink
chore: handle callback results, comment for each !== 200
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Oct 28, 2024
1 parent 009f22e commit d4a1bef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/handlers/workflow-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ export function proxyWorkflowCallbacks(context: Context): ProxyCallbacks {
return (async () => {
try {
const res = await Promise.all(target[prop].map((callback) => handleCallback(callback, context)));
logger.info(`Successfully ran ${prop} callbacks`, { res });
logger.info(`${prop} callbacks completed`, { res });
for (const r of res) {
if (r.status !== 200) {
await bubbleUpErrorComment(context, new Error(r.reason));
await exit(1);
}
}
await exit(0);
} catch (er) {
await bubbleUpErrorComment(context, er);
Expand Down

0 comments on commit d4a1bef

Please sign in to comment.