Skip to content

Commit

Permalink
Add extra metadata on fatal error to aid in debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Feb 16, 2024
1 parent 54b3af6 commit 31605ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions node-src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ export interface Context {
committerEmail?: string;
committedAt: number;
slug?: string;
fromCI: boolean;
ciService?: string;
mergeCommit?: string;
uncommittedHash?: string;
parentCommits?: string[];
Expand Down
9 changes: 8 additions & 1 deletion node-src/ui/messages/errors/fatalError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default function fatalError(
{
timestamp,
sessionId,
gitVersion: git && git.version,
gitVersion: git?.version,
gitBranch: git?.branch,
gitSlug: git?.slug,
fromCI: git?.fromCI,
ciService: git?.ciService,
nodePlatform: process.platform,
nodeVersion: process.versions.node,
...runtimeMetadata,
Expand All @@ -50,6 +54,9 @@ export default function fatalError(
flags,
...(extraOptions && { extraOptions }),
...(configuration && { configuration }),
...('options' in ctx && ctx.options?.isLocalBuild
? { isLocalBuild: ctx.options.isLocalBuild }
: {}),
...('options' in ctx && ctx.options?.buildScriptName
? { buildScript: scripts[ctx.options.buildScriptName] }
: {}),
Expand Down

0 comments on commit 31605ab

Please sign in to comment.