vapor / async-kit

Sugary extensions for the SwiftNIO library
MIT License
71 stars 25 forks source link

Add `EventLoopFuture.tryFlatMap()` by popular demand #84

Closed vzsg closed 2 years ago

vzsg commented 2 years ago

One of the most common hurdles of working with EventLoopFutures, and a very oft-repeated question on the Discord server is interacting with error-throwing code. The tryFlatMap extension alleviates that by handling any errors thrown by the closure, causing the ELF to fail.

This is the most common error handling pattern anyway.

VaporBot commented 2 years ago

These changes are now available in 1.9.0