Commit 45570366 authored by 韩桐桐's avatar 韩桐桐

fix(tcm):注册时抛出具体的异常信息

parent daf35e63
...@@ -259,8 +259,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -259,8 +259,9 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
} catch (Exception rollbackException) { } catch (Exception rollbackException) {
logger.error("回滚操作发生异常: {}", rollbackException.getMessage(), rollbackException); logger.error("回滚操作发生异常: {}", rollbackException.getMessage(), rollbackException);
} }
assert e instanceof BadRequest;
throw new RuntimeException("企业注册失败,请联系管理员!"); String err = (((BadRequest) e).getErrorCode().equals("BadRequest")) ? "企业注册失败:" + e.getMessage() : "企业注册失败,请联系管理员!" ;
throw new RuntimeException(err);
} }
return model; return model;
} }
...@@ -933,7 +934,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI ...@@ -933,7 +934,7 @@ public class RegUnitInfoServiceImpl extends BaseService<RegUnitInfoDto, RegUnitI
Privilege.agencyUserClient.multDeleteUser(userResult.getResult().getUserId()); Privilege.agencyUserClient.multDeleteUser(userResult.getResult().getUserId());
} }
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
throw new RuntimeException(e.getMessage()); throw new BadRequest(e.getMessage());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment