Preserve mixed managed endpoint diagnostics
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
2418121e05
commit
96f192e97a
1 file changed
+8
-2
@@ -88,13 +88,19 @@ function logManagedEndpointCause(
|
||||
attributes: Readonly<Record<string, unknown>>,
|
||||
) {
|
||||
const interruptionReasons = cause.reasons.filter(Cause.isInterruptReason);
|
||||
if (interruptionReasons.length > 0) {
|
||||
if (interruptionReasons.length > 0 && interruptionReasons.length === cause.reasons.length) {
|
||||
return Effect.failCause(Cause.fromReasons<never>(interruptionReasons));
|
||||
}
|
||||
return Effect.logWarning(message, {
|
||||
const log = Effect.logWarning(message, {
|
||||
...attributes,
|
||||
...managedEndpointCauseDiagnostics(cause),
|
||||
});
|
||||
if (interruptionReasons.length > 0) {
|
||||
return log.pipe(
|
||||
Effect.andThen(Effect.failCause(Cause.fromReasons<never>(interruptionReasons))),
|
||||
);
|
||||
}
|
||||
return log;
|
||||
}
|
||||
|
||||
function platformErrorDiagnostics(error: PlatformError.PlatformError) {
|
||||
|
||||
Reference in new issue
Block a user