Skip to content

Commit

Permalink
fix: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed May 18, 2024
1 parent cdbcdf1 commit 01b9898
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/utils/getIssueComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export async function getAllIssueComments(
}
} catch (e: unknown) {
shouldFetch = false;
console.error(`Fetching comments failed! reason: `, e);
return result;
}
}

export async function getIssueByNumber(context: Context, repository: Context["payload"]["repository"], issueNumber: number) {
const logger = console;
try {
const { data: issue } = await context.octokit.rest.issues.get({
owner: repository.owner.login,
Expand All @@ -72,13 +72,12 @@ export async function getIssueByNumber(context: Context, repository: Context["pa
});
return issue;
} catch (e: unknown) {
logger.debug(`Fetching issue failed! reason: ${e}`);
console.error(`Fetching issue failed! reason: `, e);
return;
}
}

export async function getPullByNumber(context: Context, repository: Context["payload"]["repository"], pullNumber: number) {
const logger = console;
try {
const { data: pull } = await context.octokit.rest.pulls.get({
owner: repository.owner.login,
Expand All @@ -87,7 +86,7 @@ export async function getPullByNumber(context: Context, repository: Context["pay
});
return pull;
} catch (error) {
logger.debug(`Fetching pull failed! reason: ${error}`);
console.error(`Fetching pull failed! reason: ${error}`);
return;
}
}
Expand Down

0 comments on commit 01b9898

Please sign in to comment.