Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d7eae64

Browse filesBrowse files
fix(core): remove duplicate error logging and improve AggregateError messages
- Remove per-provider console.error calls (rely on AggregateError for error propagation) - Include failed provider names in AggregateError message for better debugging Co-authored-by: Eric Allam <ericallam@users.noreply.github.com>
1 parent 1e29a72 commit d7eae64
Copy full SHA for d7eae64

1 file changed

+6-4Lines changed: 6 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/core/src/v3/otel/tracingSDK.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/v3/otel/tracingSDK.ts
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,15 @@ export class TracingSDK {
376376
]);
377377
const providerNames = ["trace", "log", "meter"] as const;
378378
const errors: Error[] = [];
379+
const failedNames: string[] = [];
379380
results.forEach((result, index) => {
380381
if (result.status === "rejected") {
381-
console.error(`Failed to flush ${providerNames[index]} provider:`, result.reason);
382+
failedNames.push(providerNames[index]);
382383
errors.push(result.reason instanceof Error ? result.reason : new Error(String(result.reason)));
383384
}
384385
});
385386
if (errors.length > 0) {
386-
throw new AggregateError(errors, "One or more providers failed to flush");
387+
throw new AggregateError(errors, `One or more providers failed to flush: ${failedNames.join(", ")}`);
387388
}
388389
}
389390

@@ -395,14 +396,15 @@ export class TracingSDK {
395396
]);
396397
const providerNames = ["trace", "log", "meter"] as const;
397398
const errors: Error[] = [];
399+
const failedNames: string[] = [];
398400
results.forEach((result, index) => {
399401
if (result.status === "rejected") {
400-
console.error(`Failed to shutdown ${providerNames[index]} provider:`, result.reason);
402+
failedNames.push(providerNames[index]);
401403
errors.push(result.reason instanceof Error ? result.reason : new Error(String(result.reason)));
402404
}
403405
});
404406
if (errors.length > 0) {
405-
throw new AggregateError(errors, "One or more providers failed to shutdown");
407+
throw new AggregateError(errors, `One or more providers failed to shutdown: ${failedNames.join(", ")}`);
406408
}
407409
}
408410
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.