Skip to content

Commit

Permalink
fix(build-error): add core step id to the build error type and traces
Browse files Browse the repository at this point in the history
  • Loading branch information
JGAntunes committed Nov 13, 2023
1 parent 916a54c commit 3449a89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/build/src/error/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export type BasicErrorInfo = {
errorInfo: ErrorInfo
errorProps: Record<string, unknown>
errorMetadata: any
/**
* The core step id where the error took place
*/
stage?: string
tsConfigInfo?: any
} & ErrorType

Expand Down Expand Up @@ -181,6 +185,7 @@ export const buildErrorToTracingAttributes = function (error: BuildError | Basic
if (error?.severity) attributes[`${buildErrorAttributePrefix}.severity`] = error.severity
if (error?.type) attributes[`${buildErrorAttributePrefix}.type`] = error.type
if (error?.locationType) attributes[`${buildErrorAttributePrefix}.location.type`] = error.locationType
if (error?.stage) attributes[`${buildErrorAttributePrefix}.step.id`] = error.stage
return {
...attributes,
...errorLocationToTracingAttributes(error.errorInfo?.location),
Expand Down

0 comments on commit 3449a89

Please sign in to comment.