Skip to content

Commit

Permalink
chore: debug logger
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Dec 9, 2024
1 parent e0b5122 commit bf3d664
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/handlers/call-personal-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,27 @@ export async function callPersonalAgent(context: Context) {
return;
}

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

Check failure on line 32 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 32 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 32 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 32 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", {
console.log(
`commenting
${JSON.stringify({
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() });
}
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 Down

0 comments on commit bf3d664

Please sign in to comment.