java - 抱怨在声纳中记录和重新抛出异常
问题描述
我的程序中有以下代码,在将其与 Maven 集成后,我正在运行 SonarQube 以对其进行代码质量检查。
但是,Sonar 抱怨我应该记录或重新抛出此异常。
我在这里想念什么?我还没有记录异常吗?
public AccountResponse getAccountStatus(AccessIDSearchResponse accessIDResponse) {
accountResponse = null;
try {
AccountRequest request = new AccountRequest();
} catch (ServiceException serviceException) {
log.error("getAccountStatus-GotServiceException =" + ExceptionUtils.getStackTrace(serviceException));
throw serviceException;
} catch (Exception e) {
throw new ServiceException(ErrorMessages.EPO_SYSTEM_ERROR, e.getMessage());
}
return accountResponse;
}
解决方案
推荐阅读
- python - 调用“打印”时缺少括号
- business-process-management - 如何在 Workfusion RPA Express 中将变量值从一个机器人任务传输到另一个机器人任务?
- java - 与迭代器一起使用时,openCSV CSVReader getRecordsRead 方法返回错误计数
- maven - Mulesoft Munit Maven 构建失败
- linux - 如何在linux中添加打印语句来计算带有关键字的行数
- object - 如何找到没有循环的javascript对象的最后一个元素?
- c - 使用模数的 C 加法
- php - 使用 curl php 发送多个文件数据(要发送的文件数量不同)
- node.js - 客户端正在与 mosquitto 代理断开连接,并且不再连接到同一个代理
- java - 结果集在 Java 中不起作用