mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
Merge pull request #280 from ruansheng8/fix-unwrapEx
修复使用Mappers执行语法时, 异常未被精确抛出问题
This commit is contained in:
commit
23624147d5
@ -18,6 +18,7 @@ package com.mybatisflex.core.mybatis;
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.mybatisflex.core.FlexGlobalConfig;
|
||||
import com.mybatisflex.core.exception.FlexExceptions;
|
||||
import org.apache.ibatis.reflection.ExceptionUtil;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
@ -108,6 +109,8 @@ public class Mappers {
|
||||
try (SqlSession sqlSession = openSession()) {
|
||||
Object mapper = sqlSession.getMapper(mapperClass);
|
||||
return method.invoke(mapper, args);
|
||||
} catch (Throwable throwable) {
|
||||
throw ExceptionUtil.unwrapThrowable(throwable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user