Akka:Http:onComplete
lastmod 2026-11-10created 2020-09-243 edits
onComplete is one of the Future directives in the Akka HTTP routing DSL; it waits until the given Future[T] completes and then passes the result to the inner route as a Try[T]. Because success (Success) and failure (Failure) can be separated by pattern matching to return different responses, it is used when you want to handle exceptions from asynchronous work explicitly inside the route. To pass failures to the exception handler and handle only success, use onSuccess.
akka onComplete