Align error logging with admin dashboard field conventions

All warn/error log calls now use field names the dashboard's decorate()
function recognizes: `code` for the error code pill, `httpStatus` for the
status badge and severity bucket, `url` for the sidebar link, and
`repoId` for the repository link.

Key changes:
- Streamer errors surface code, httpStatus, url, and nested err in Raw tab
- Nested `{ err: serializeError(e) }` replaced with spread pattern so
  error fields (name, message, status) appear at the top level
- Raw Error objects in catch blocks now go through serializeError()
- Rate limit, token, and PR 404 warnings include code + httpStatus
- Dashboard stack walker traverses both `cause` and `err` chains
- Dashboard Raw tab renders repoId, filePath, upstream*, err, and cause
- trimRawArg recursively trims stacks in nested err/cause chains
- clampPayload strips heavy nested fields before falling back to
  truncated placeholder, preserving flat diagnostic fields
This commit is contained in:
tdurieux committed 2026-05-07 05:54:18 +03:00
1 parent b8cfe293ea
commit 9403f15ac3
8 files changed
+63 -18

No files matched your search

+6
View File
@@ -43,6 +43,8 @@ export default class PullRequest {
return this._model.source.accessToken;
} catch {
logger.warn("invalid token", {
code: "invalid_token",
httpStatus: 401,
pullRequestId: this._model.source.pullRequestId,
});
}
@@ -92,6 +94,8 @@ export default class PullRequest {
}> => {
if ((err as { status?: number }).status === 404) {
logger.warn("PR comments 404, continuing without them", {
code: "pr_comments_not_found",
httpStatus: 404,
pr: `${owner}/${repo}#${pull_number}`,
});
return [];
@@ -104,6 +108,8 @@ export default class PullRequest {
).catch((err) => {
if (err instanceof HTTPError && err.response.statusCode === 404) {
logger.warn("PR diff 404, continuing without it", {
code: "pr_diff_not_found",
httpStatus: 404,
pr: `${owner}/${repo}#${pull_number}`,
});
return { body: "" };