zheng icon indicating copy to clipboard operation
zheng copied to clipboard

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

Open bighhhh opened this issue 3 years ago • 2 comments

@Override public List<Record> 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<Record>) result; } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } DynamicDataSource.clearDataSource(); return null; } 所有异常都给捕获了,并且也没打印日志,为啥不把异常抛给controller处理

bighhhh avatar Dec 30 '21 07:12 bighhhh

这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

uncleCG avatar Dec 30 '21 07:12 uncleCG

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

bilifuture avatar Dec 30 '21 07:12 bilifuture