在处理异常时如何获取上下文?
promise.thenApplyAsync(
result -> {
// do something
}, ec.current()
).exceptionally(
throwable -> {
//how to get current execution context here?
}
);
如果我在异常代码中执行ctx().id()
,则会收到错误消息java.util.concurrent.CompletionException: java.lang.RuntimeException: There is no HTTP Context available from here.