asarazan / bismarck

Caching for Kotlin Multiplatform
Apache License 2.0
4 stars 1 forks source link

Ability to clear errors? #14

Open vaudevillen opened 4 years ago

vaudevillen commented 4 years ago

Because eachError is backed by a ConflatedBroadcastChannel, it'll replay errors, but I might not be concerned with any previous error values. It would be nice if we could either clear the error, or have this work like a flow and "drop" the first error. Also, this seems related to issue https://github.com/asarazan/bismarck/issues/13, and could be solved by adding the ability to manually update the error value

asarazan commented 4 years ago

From a philosophical standpoint, a system should be considered "in error" for the entire time that it cannot acquire a new value. Therefore the only "true" way to clear an error is to execute a successful fetch.

Right now I'm leaning toward restricting any external control over errors because it might confuse or dilute their meaning.