refactor: consider using `Result` type
- Dominant language
- Nim
- Stars
- 23
- Forks
- 17
- Avg merge
- 13h 57m
- Merged PRs (30d)
- 1
Description
Pros: can enforce that every error is handled, and see that at the callsite
Cons: may not worth the added noise, and can make exceptions visible with just `{.raises: [FooError].}`
Links:
- https://github.com/arnetheduck/nim-result/
- https://github.com/status-im/nim-stew/blob/f2e58ba4c8da65548c824e4fa8732db9739f6505/stew/results.nim
- https://github.com/status-im/questionable
- https://status-im.github.io/nim-style-guide/errors.html
- https://forum.nim-lang.org/t/8759#57086
- https://joeduffyblog.com/2016/02/07/the-error-model/
Other languages:
- Rust: https://doc.rust-lang.org/std/result/enum.Result.html
- Haskell: https://hackage.haskell.org/package/base-4.17.0.0/docs/Data-Either.html
- C++: https://github.com/ned14/outcome
- C++: https://google.github.io/styleguide/cppguide.html#Exceptions
- Swift: https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html
Related:
- https://github.com/exercism/configlet/issues/123
- https://github.com/exercism/configlet/issues/365
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.