From cef3371aa84bb7bbe79355cf3423011c89b0d462 Mon Sep 17 00:00:00 2001 From: Iliyan Germanov Date: Fri, 2 Aug 2024 11:15:23 +0300 Subject: [PATCH] Update Error-Handling.md --- docs/guidelines/Error-Handling.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guidelines/Error-Handling.md b/docs/guidelines/Error-Handling.md index 7986901eb0..c4e86e26bd 100644 --- a/docs/guidelines/Error-Handling.md +++ b/docs/guidelines/Error-Handling.md @@ -99,6 +99,7 @@ I strongly recommend allocating some time to also go through [Arrow's Working wi - Either is a [monad](https://en.wikipedia.org/wiki/Monad_(functional_programming)). - `Either` is equivalent to Kotlin's std `Result` type. - Many projects create a custom `Result` while they can just use `Either` with all its built-in features. +- It's similar to the [Kotlin `Result`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-result/) but it's better because the error type isn't constraint only to `Throwable`. In fact, `Either` is equivalent to `Result` > In some rare cases, it's okay to `throw` a runtime exception. These are the cases in which you're okay and want the app to crash > (e.g., not enough disk space to write in Room DB / local storage).