fix: 修复DB层异常捕获失败
This commit is contained in:
@@ -31,7 +31,7 @@ public class CustomExcelUtil {
|
||||
writeToOutputStream(list, clazz, response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new ApiException(Internal.UNKNOWN_ERROR);
|
||||
throw new ApiException(e, Internal.UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ public class DbExceptionAspect {
|
||||
try {
|
||||
proceed = joinPoint.proceed();
|
||||
} catch (Exception e) {
|
||||
throw new ApiException(e, ErrorCode.Internal.DB_INTERNAL_ERROR, e.getCause().getMessage());
|
||||
throw new ApiException(e, ErrorCode.Internal.DB_INTERNAL_ERROR,
|
||||
e.getCause() != null ? e.getCause().getMessage() : ErrorCode.UNKNOWN_ERROR.message());
|
||||
}
|
||||
return proceed;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ logging:
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
# 开启Swagger UI界面 **安全考虑的话生产环境需要关掉**
|
||||
# ***注意*** 开启Swagger UI界面 **安全考虑的话生产环境需要关掉**
|
||||
# 因为knife4j的一些配置不灵活 所以重新改回springdoc+swagger的组合 真实开发的时候 使用apifox这种工具效率更高
|
||||
enabled: true
|
||||
url: ${agileboot.api-prefix}/v3/api-docs
|
||||
|
||||
Reference in New Issue
Block a user