Skip to content

Commit

Permalink
fix: Enhance error logging by formatting stack trace output for bette…
Browse files Browse the repository at this point in the history
…r readability in index.ts
  • Loading branch information
austenstone committed Nov 26, 2024
1 parent 7870c08 commit a4cfab9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29168,14 +29168,14 @@ catch (e) {
}
: {};
stackInfo.file = stackInfo.file?.split("/").slice(6).join("/");
(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.error)(`${e.message}\n${JSON.stringify(e)}`, {
(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.error)(`${e.message}\n${JSON.stringify(e, null, 2)}`, {
title: e.name,
...stackInfo,
});
}
throw e;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZmlsZTovLy9DOi9Vc2Vycy9hdXN0ZS9zb3VyY2UvYWN0aW9uLXR5cGVzY3JpcHQvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsSUFBSSxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDN0QsT0FBTyxFQUFFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUV0RCxNQUFNLEtBQUssR0FBRztJQUNaLEtBQUssRUFBRSxRQUFRLENBQUMsY0FBYyxDQUFDO0NBQ2hDLENBQUM7QUFFRixJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDckMsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsT0FBTyxDQUFDLElBQUksRUFBRSxJQUFJLEVB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BQVksS0FBSyxFQUFFLENBQUM7UUFDdkIsTUFBTSxjQUFjLEdBQUcsQ0FBQyxDQUFDLEtBQUs7WUFDNUIsRUFBRSxLQUFLLENBQUMsSUFBSSxDQUFDO2FBQ1osR0FBRyxFQUFFO1lBQ04sRUFBRSxLQUFLLENBQUMsS0FBSyxDQUFDO2FBQ2IsR0FBRyxFQUFFO1lBQ04sRUFBRSxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7UUFDZixNQUFNLFNBQVMsR0FBRyxjQUFjO1lBQzlCLENBQUMsQ0FBQztnQkFDRSxJQUFJLEVBQUUsY0FBYyxDQUFDLENBQUMsQ0FBQztnQkFDdkIsU0FBUyxFQUFFLFFBQVEsQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ3RDLFdBQVcsRUFBRSxRQUFRLENBQUMsY0FBYyxDQUFDLENBQUMsQ0FBQyxDQUFDO2FBQ3pDO1lBQ0gsQ0FBQyxDQUFDLEVBQUUsQ0FBQztRQUVQLFNBQVMsQ0FBQyxJQUFJLEdBQUcsU0FBUyxDQUFDLElBQUksRUFBRSxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUMvRCxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUMsT0FBTyxLQUFLLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxFQUFFLElBQUksRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFO1lBQ25ELEtBQUssRUFBRSxDQUFDLENBQUMsSUFBSTtZQUNiLEdBQUcsU0FBUztTQUNiLENBQUMsQ0FBQztJQUNMLENBQUM7SUFDRCxNQUFNLENBQUMsQ0FBQztBQUNWLENBQUMifQ==
__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } }, 1);

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const input = {
token: getInput("github-token"),
};

info(JSON.stringify(input, null, 2));
info(JSON.stringify(context.repo, null, 2));

const octokit = getOctokit(input.token);

try {

Check failure on line 10 in src/index.ts

View workflow job for this annotation

GitHub Actions / run

Resource not accessible by integration { "name": "HttpError", "status": 403, "response": { "url": "https://api.github.com/user", "status": 403, "headers": { "access-control-allow-origin": "*", "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "content-encoding": "gzip", "content-security-policy": "default-src 'none'", "content-type": "application/json; charset=utf-8", "date": "Tue, 26 Nov 2024 17:03:54 GMT", "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "server": "github.com", "strict-transport-security": "max-age=31536000; includeSubdomains; preload", "transfer-encoding": "chunked", "vary": "Accept-Encoding, Accept, X-Requested-With", "x-accepted-github-permissions": "allows_permissionless_access=true", "x-content-type-options": "nosniff", "x-frame-options": "deny", "x-github-api-version-selected": "2022-11-28", "x-github-media-type": "github.v3; format=json", "x-github-request-id": "1500:27F92D:1592549:2AB636A:6745FF7A", "x-ratelimit-limit": "5000", "x-ratelimit-remaining": "4999", "x-ratelimit-reset": "1732644234", "x-ratelimit-resource": "core", "x-ratelimit-used": "1", "x-xss-protection": "0" }, "data": { "message": "Resource not accessible by integration", "documentation_url": "https://docs.github.com/rest/users/users#get-the-authenticated-user", "status": "403" } }, "request": { "method": "GET", "url": "https://api.github.com/user", "headers": { "accept": "application/vnd.github.v3+json", "user-agent": "octokit-core.js/5.1.0 Node.js/20.18.0 (linux; x64)", "authorization": "token [REDACTED]" }, "request": { "agent": { "_events": {}, "_eventsCount": 2, "defaultPort": 443, "protocol": "https:", "options": { "keepAlive": true, "scheduling": "lifo", "timeout": 5000, "noDelay": true, "path": null }, "requests": {}, "sockets": {}, "freeSockets": {}, "keepAliveMsecs": 1000, "keepAlive": true, "maxSockets": null, "maxFreeSockets": 256, "scheduling": "lifo", "maxTotalSockets": null, "totalSocketCount": 0, "maxCachedSessions": 100, "_sessionCache": { "map": {}, "list": [] } } } } }
Expand Down Expand Up @@ -40,7 +37,7 @@ try {
: {};

stackInfo.file = stackInfo.file?.split("/").slice(6).join("/");
error(`${e.message}\n${JSON.stringify(e)}`, {
error(`${e.message}\n${JSON.stringify(e, null, 2)}`, {
title: e.name,
...stackInfo,
});
Expand Down

0 comments on commit a4cfab9

Please sign in to comment.