diff --git a/apps/server/src/cloud/ManagedEndpointRuntime.ts b/apps/server/src/cloud/ManagedEndpointRuntime.ts index db9c4f9b2d..a7454178bd 100644 --- a/apps/server/src/cloud/ManagedEndpointRuntime.ts +++ b/apps/server/src/cloud/ManagedEndpointRuntime.ts @@ -88,13 +88,19 @@ function logManagedEndpointCause( attributes: Readonly>, ) { 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(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(interruptionReasons))), + ); + } + return log; } function platformErrorDiagnostics(error: PlatformError.PlatformError) {