From 61caa521df929eebae7fd085d4b57c77caebdfcf Mon Sep 17 00:00:00 2001 From: ruansheng Date: Tue, 20 Feb 2024 10:12:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8Mappers?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E8=AF=AD=E6=B3=95=E6=97=B6,=20=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=9C=AA=E8=A2=AB=E7=B2=BE=E7=A1=AE=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/mybatisflex/core/mybatis/Mappers.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/Mappers.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/Mappers.java index 73da2843..ddcad0b8 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/Mappers.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/mybatis/Mappers.java @@ -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); } }