Skip to content

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

@bighhhh

Description

@bighhhh

@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处理

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions