Effect CommunityEC
Effect Community2y ago
10 replies
imagio

Removing `OfflineError` from Retry Error Channel

What's the best way to remove an error type when using retry? For example I want to retry forever as long as the error is OfflineError so it should be removed from the error channel but I'm not sure of the best way to do that.

// Type still includes OfflineError even though it will never actually fail with OfflineError
pipe(
   someEffect,
   Effect.retry({ while: err => err._tag === "OfflineError", schedule: Schedule.spaced(Duration.seconds(2)) }),
)
Was this page helpful?