Skip to content

Commit d7eae64

Browse 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

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,15 @@ export class TracingSDK {
376376
]);
377377
constproviderNames=["trace","log","meter"]asconst;
378378
consterrors: Error[]=[];
379+
constfailedNames: 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.reasoninstanceofError ? result.reason : newError(String(result.reason)));
383384
}
384385
});
385386
if(errors.length>0){
386-
thrownewAggregateError(errors,"One or more providers failed to flush");
387+
thrownewAggregateError(errors,`One or more providers failed to flush: ${failedNames.join(", ")}`);
387388
}
388389
}
389390

@@ -395,14 +396,15 @@ export class TracingSDK {
395396
]);
396397
constproviderNames=["trace","log","meter"]asconst;
397398
consterrors: Error[]=[];
399+
constfailedNames: 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.reasoninstanceofError ? result.reason : newError(String(result.reason)));
402404
}
403405
});
404406
if(errors.length>0){
405-
thrownewAggregateError(errors,"One or more providers failed to shutdown");
407+
thrownewAggregateError(errors,`One or more providers failed to shutdown: ${failedNames.join(", ")}`);
406408
}
407409
}
408410
}

0 commit comments

Comments
 (0)