Skip to content

Commit

Permalink
chore: debug create comment first
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Dec 9, 2024
1 parent 5c302c6 commit b008bdd
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/handlers/call-personal-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ export async function callPersonalAgent(context: Context) {
return;
}

try {
const errComment = ["```diff", `! There was a problem calling the personal agent of ${personalAgentOwner}`, "```"].join("\n");

Check failure on line 33 in src/handlers/call-personal-agent.ts

View workflow job for this annotation

GitHub Actions / build

Block-scoped variable 'personalAgentOwner' used before its declaration.

Check failure on line 33 in src/handlers/call-personal-agent.ts

View workflow job for this annotation

GitHub Actions / build

Variable 'personalAgentOwner' is used before being assigned.

Check failure on line 33 in src/handlers/call-personal-agent.ts

View workflow job for this annotation

GitHub Actions / build

Block-scoped variable 'personalAgentOwner' used before its declaration.

Check failure on line 33 in src/handlers/call-personal-agent.ts

View workflow job for this annotation

GitHub Actions / build

Variable 'personalAgentOwner' is used before being assigned.

logger.info("commenting", {
body: errComment,
repo,
owner,
issue_number: payload.issue.number,
});

await context.octokit.rest.issues.createComment({
body: errComment,
repo,
owner,
issue_number: payload.issue.number,
});
} catch (err) {
logger.error(`Error commenting:`, { err, error: new Error() });
}

const personalAgentOwner = targetUser[0].replace("/@", "");
logger.info(`Comment received:`, { owner, personalAgentOwner, comment: body });

Expand All @@ -55,25 +75,6 @@ export async function callPersonalAgent(context: Context) {
ref: "development",
});
} catch (error) {
try {
const errComment = ["```diff", `! There was a problem calling the personal agent of ${personalAgentOwner}`, "```"].join("\n");

logger.info("commenting", {
body: errComment,
repo,
owner,
issue_number: payload.issue.number,
});

await context.octokit.rest.issues.createComment({
body: errComment,
repo,
owner,
issue_number: payload.issue.number,
});
} catch (err) {
logger.error(`Error commenting:`, { err, error: new Error() });
}
logger.error(`Error dispatching workflow:`, { err: error, error: new Error() });

throw error;
Expand Down

0 comments on commit b008bdd

Please sign in to comment.