Back To Schedule
Saturday, November 18 • 1:10pm - 1:30pm
Error Handling Without Throwing Exceptions

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Feedback form is now closed.
In a microservice environment, it is painful to handle exceptions thrown by external services. We designed a mechanism for type-safe error handling using EitherT monad transformer to stack Future and Either. Calls to external services are implemented in a stack of EitherT for fail-fast error handling. Errors are separated for each logical external services. Error hierarchy is defined to expose different layers of the system. Location and reason of an error are provided for debugging. In addition, we validated input to each call of external service by Validated to accumulate errors. Validation rules are tested by property-based testing with ScalaCheck. We implemented both fail-fast and accumulated error handling with Cats in payment service for shopbot.

avatar for Haeley Yao

Haeley Yao

Software Engineer, eBay
Haeley is a software engineer at eBay who works on building human assistant shopping bot and a shopping app targeted at Chinese customers, using Scala, Cats and microservice-based architecture. Haeley is interested in applying pure FP in large enterprise applications.

Saturday November 18, 2017 1:10pm - 1:30pm PST