scala/scala-async

Chain exception causes

pkolaczk opened this issue · 0 comments

When an asynchronous operation that is a part of another asynchronous operation fails, it would be very helpful to get a full stacktrace from the topmost async to the bottommost Future that reported the failure. Currently, only the bottommost failure is reported. This + lack of ability to debug + lack of try/catch makes async/await code very hard to debug.

Example:

def doSomethingAsync: Future[Int] = {
   async {
   // ... 
     throw new IOException("Something went wrong...")  // this line is reported properly
   }
}

def caller: Future[Int] = {
  async {
     await(doSomethingAsync)    // << I'd like this line to be reported in the stacktrace as well
  }
}