Error Handling Without Throwing Exceptions
summary
Payment service for a shopping bot at eBay uses EitherT stacking Future+Either so asynchronous calls to external services short‑circuit on the first failure and still carry typed error payloads. Validation of inputs uses Validated for accumulating errors so field‑level problems are collected, and an error hierarchy records which external service, location and reason caused each failure. Validation rules are checked with ScalaCheck property‑based tests, and both fail‑fast and accumulated flows are implemented with Cats.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 3:23Problems with exceptions
- 6:37Alternatives to exceptions
- 8:08Handling external services
- 11:24Refactoring error handling
- 15:11Resources and conclusion
related talks
16mGetting started with EitherT
39mFunctional Error Handling with Cats
32mA practical introduction to category theory
44mError Handling Beyond the Standard Library
53mKleisli, a Friend Who Means You Well
49mAre promises our only choice?
43mFunctional Error Handling
37mA Skeptic’s Look at scalaz’ Gateway Drugs: A Practical Exploration
