Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Update Error-Handling.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV authored Aug 2, 2024
1 parent 569e6df commit cef3371
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/guidelines/Error-Handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Throwable, T>` is equivalent to Kotlin's std `Result` type.
- Many projects create a custom `Result<E, T>` 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<Throwable, V>` is equivalent to `Result<V>`

> 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).

0 comments on commit cef3371

Please sign in to comment.