Closed matt-ramotar closed 10 months ago
@digitalbuddha We would need to fix tests obviously but I wanted to get something up first for discussion. Adding a generic to StoreReadResponse
and FetcherResult
would introduce breaking changes I know we don't want. Thoughts?
@matt-ramotar thanks for bringing up implementation ideas so quickly. Would it be possible for the Custom
error to accept any type instead of only Throwable
? As an example, our network layer uses a sealed interface with no Throwable inheritance. Something like this
sealed interface NetworkError {
data class StatusCodeError(val statusCode: Int, val error: CustomApiError?) : NetworkError
data class UnknownError(val throwable: Throwable) : NetworkError
data object NetworkUnavailableError : NetworkError
}
@borsini Seems fine to me 👍🏽
Hello @matt-ramotar, I checked how this PR was doing and came up with an idea. I created this little draft PR to illustrate my thinking. What if, instead of having a sealed hierarchy, Store use only one generic Error
type.
Let me know what you think 😄
Sorry to be slow @borsini, will try to get this merged by end of week
No worries @matt-ramotar this is open source 🙂
https://kotlinlang.slack.com/archives/C06007Z01HU/p1699457424194509