Handling Email Job Decoding with Error Logging in TypeScript

Does this look reasonable, or am I missing a nice API?
    const maybeEmailJob = yield* Effect.either(S.decodeUnknownEither(EmailJobBodySchema)(message.body))
    if (maybeEmailJob._tag === "Left") {
      yield* Effect.logError(`Failed to decode email job`, Cause.fail(maybeEmailJob.left), Cause.fail(message))
      message.ack()
      continue
    }
Was this page helpful?