Skip to content

Commit

Permalink
Mention toThrow() in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andrenarchy committed Apr 6, 2021
1 parent 04c7111 commit 1bd8f83
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ You may wonder why `fefe` does not just throw an error and the answer is:
You can read more about it [here](https://medium.com/nmc-techblog/functional-error-handling-in-js-8b7f7e4fa092).
For simplifying the transition from a 2.x codebase you can use the `toThrow(t: Transformer<V, T>): (v: V) => T` function that returns the value directly and throws instead of returning a `FefeError` in the case of an error. Note that the thrown `FefeThrowError` has a different structure than the pre-3.x `FefeError`.
### Validator<T>
Expand Down

0 comments on commit 1bd8f83

Please sign in to comment.