Skip to content

Commit c128819

Browse files
committed
The logger now supports metadata
1 parent 0448f36 commit c128819

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

internal-packages/run-engine/src/engine/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export function runStatusFromError(error: TaskRunError): TaskRunStatus {
5959
export class ServiceValidationError extends Error {
6060
constructor(
6161
message: string,
62-
public status?: number
62+
public status?: number,
63+
public metadata?: Record<string, unknown>
6364
) {
6465
super(message);
6566
this.name = "ServiceValidationError";

packages/core/src/logger.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ function extractStructuredErrorFromArgs(...args: Array<Record<string, unknown> |
147147
message: error.message,
148148
stack: error.stack,
149149
name: error.name,
150+
metadata: "metadata" in error ? error.metadata : undefined,
150151
};
151152
}
152153

@@ -157,6 +158,7 @@ function extractStructuredErrorFromArgs(...args: Array<Record<string, unknown> |
157158
message: structuredError.error.message,
158159
stack: structuredError.error.stack,
159160
name: structuredError.error.name,
161+
metadata: "metadata" in structuredError.error ? structuredError.error.metadata : undefined,
160162
};
161163
}
162164

0 commit comments

Comments
 (0)