Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseServiceImpl中的service为什么把抛出的异常都给吃了,而不给抛出来呢 #230

Open
bighhhh opened this issue Dec 30, 2021 · 2 comments

Comments

@bighhhh
Copy link

bighhhh commented Dec 30, 2021

@OverRide
public List selectByExample(Example example) {
try {
DynamicDataSource.setDataSource(DataSourceEnum.SLAVE.getName());
Method selectByExample = mapper.getClass().getDeclaredMethod("selectByExample", example.getClass());
Object result = selectByExample.invoke(mapper, example);
return (List) result;
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
DynamicDataSource.clearDataSource();
return null;
}
所有异常都给捕获了,并且也没打印日志,为啥不把异常抛给controller处理

@uncleCG
Copy link

uncleCG commented Dec 30, 2021 via email

@bilifuture
Copy link

bilifuture commented Dec 30, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants