exception - 如何在 Spring webflux 中处理 IOException?
问题描述
我试图从我的 Mono 中检索 byte[],但使用 getBytes() 方法显示未处理的 IOException。如何在我的反应式代码中处理它?
我的服务层
public HttpStatus excel(Mono<MultipartFile> filePartMono) {
Excel t = new Excel();
t.setExcel(filePartMono.map(filepart-> {
try {
return filepart.getBytes();
} catch (IOException e) {
System.out.println(e);
}
return new **byte[];** //doing this here it shows array initializer expected what does it mean
}));
excelRepository.save(t);
return HttpStatus.ACCEPTED>;
解决方案
推荐阅读
- python - 使用 numpy 获取 n 维的泛化乘法表
- python - 如何为两个以上的类显示最多信息的特征?
- java - 尝试通过玩家输入进行银行存款
- python - 虹膜数据集的可视化和朴素贝叶斯模型
- python - 如何使用 python 将 iOS 通知链接到 aibo ERS_1000?
- css - How to add a working link to external css file in .NET core 5 project
- core-data - SwiftUI - CoreData one too many relationship append array
- python-3.x - textwarp.dedent is not properly working on a multi line XML string
- python - Xcode: 'ModuleNotFoundError'
- python - Matplotlib fill_between edge