mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-04-26 07:58:34 +08:00
update 新增支持占位符格式的 ServiceException 构造方法
- 新增 ServiceException(String message, Object... args) 构造器,内部使用 Hutool StrFormatter.format 格式化消息
- 解决日志打印和异常抛出信息格式不统一的问题,统一使用 {} 占位符
- 优化异常消息书写,简化拼接,提升代码可读性和维护性
This commit is contained in:
@@ -119,7 +119,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
*/
|
||||
private void validEntityBeforeSave(SysOssConfig entity) {
|
||||
if (StringUtils.isNotEmpty(entity.getConfigKey()) && !checkConfigKeyUnique(entity)) {
|
||||
throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!");
|
||||
throw new ServiceException("操作配置'{}'失败, 配置key已存在!", entity.getConfigKey());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user