0
我試圖寫一個自動的reactiv方式傳播檢查的異常,而無需編寫鍋爐板代碼與我的運營商內部的靜態塊的工具:rxjava反應器,工具傳播例外
public class ReactRethrow {
public static <T, R> Function<T, R> rethrow(Function<T, R> catchedFunc) {
return t -> {
try {
return catchedFunc.apply(t);
} catch (Exception e) {
throw Exceptions.propagate(e);
}
};
}
}
但還是老樣子抱怨關於IOException在這裏:
Flux.fromArray(resources).map(ReactRethrow.rethrow(resource -> Paths.get(resource.getURI())))
有什麼想法嗎?