File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
src/main/java/org/mybatis/spring Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2010-2022 the original author or authors.
2
+ * Copyright 2010-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -85,6 +85,7 @@ public DataAccessException translateExceptionIfPossible(RuntimeException e) {
85
85
if (e .getCause () instanceof PersistenceException ) {
86
86
e = (PersistenceException ) e .getCause ();
87
87
}
88
+ String msg = e .getMessage ();
88
89
if (e .getCause () instanceof SQLException ) {
89
90
this .initExceptionTranslator ();
90
91
String task = e .getMessage () + "\n " ;
@@ -94,7 +95,7 @@ public DataAccessException translateExceptionIfPossible(RuntimeException e) {
94
95
} else if (e .getCause () instanceof TransactionException ) {
95
96
throw (TransactionException ) e .getCause ();
96
97
}
97
- return new MyBatisSystemException (e );
98
+ return new MyBatisSystemException (msg , e );
98
99
}
99
100
return null ;
100
101
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2010-2022 the original author or authors.
2
+ * Copyright 2010-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@ public class MyBatisSystemException extends UncategorizedDataAccessException {
31
31
32
32
private static final long serialVersionUID = -5284728621670758939L ;
33
33
34
- public MyBatisSystemException (Throwable cause ) {
35
- super (null , cause );
34
+ public MyBatisSystemException (String msg , Throwable cause ) {
35
+ super (msg , cause );
36
36
}
37
37
38
38
}
You can’t perform that action at this time.
0 commit comments