Skip to content

Commit

Permalink
fix: dont throw if error does not have response attached (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored Jul 16, 2024
1 parent 8d5c278 commit ab4932c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function requestLog(octokit: Octokit) {

.catch((error) => {
const requestId =
error.response.headers["x-github-request-id"] || "UNKNOWN";
error.response?.headers["x-github-request-id"] || "UNKNOWN";
octokit.log.error(
`${requestOptions.method} ${path} - ${error.status} with id ${requestId} in ${
Date.now() - start
Expand Down

0 comments on commit ab4932c

Please sign in to comment.