【发布时间】:2021-04-30 20:33:55
【问题描述】:
我有以下代码
.map(agc -> new cTaskServiceCommand(or, agc, request))
.flatMap(command -> cTaskService.cTask(command))
.flatMapMany(event -> Mono.just(event).concatWith(Mono.justOrEmpty(event.getThrowable()).flatMap(Mono::error)))
.cast(orEvent.class)
.onErrorResume(throwable -> myFactory.createorEvent(or, throwable))
但我想将一个参数从命令传递给 onErrorResume,如下所示
.onErrorResume(throwable -> myFactory.createorEvent(or, throwable, command.getName()))
我怎样才能做到这一点。需要将参数从之前的 flatMap 对象传递给 onErrorResume。
【问题讨论】: