https://github.com/peterperhac/errorhandling-with-optics-http4s
Tinkering with ideas presented by Gabriel Volpe. Exhaustive pattern matching on errors while avoiding EitherTs
https://github.com/peterperhac/errorhandling-with-optics-http4s
cats cats-effect error-handling http4s
Last synced: 10 months ago
JSON representation
Tinkering with ideas presented by Gabriel Volpe. Exhaustive pattern matching on errors while avoiding EitherTs
- Host: GitHub
- URL: https://github.com/peterperhac/errorhandling-with-optics-http4s
- Owner: PeterPerhac
- License: other
- Created: 2018-09-04T22:03:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-20T21:26:49.000Z (over 7 years ago)
- Last Synced: 2025-04-22T14:21:17.057Z (about 1 year ago)
- Topics: cats, cats-effect, error-handling, http4s
- Language: Scala
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Error handling within an http4s Web application
Modeling errors via a sealed trait and having exhaustive pattern matching in error handler associated with an http4s service, without EitherT - just using MonadError and an optics library that derives MonadError instances
Took me a while to get all the moving parts together into a working example. The code is based on Gabriel Volpe's article here: https://typelevel.org/blog/2018/08/25/http4s-error-handling-mtl.html and this Gist: https://gist.github.com/gvolpe/3fa32dd1b6abce2a5466efbf0eca9e94
date first implemented: 2018-09-04