[#4391] Example exception translator should only translate SQLException
This commit is contained in:
parent
c270e6281a
commit
783dc5461a
@ -69,11 +69,15 @@ public class ExceptionTranslator extends DefaultExecuteListener {
|
||||
|
||||
@Override
|
||||
public void exception(ExecuteContext ctx) {
|
||||
SQLDialect dialect = ctx.configuration().dialect();
|
||||
SQLExceptionTranslator translator = (dialect != null)
|
||||
? new SQLErrorCodeSQLExceptionTranslator(dialect.name())
|
||||
: new SQLStateSQLExceptionTranslator();
|
||||
|
||||
// [#4391] Translate only SQLExceptions
|
||||
if (ctx.sqlException() != null) {
|
||||
SQLDialect dialect = ctx.configuration().dialect();
|
||||
SQLExceptionTranslator translator = (dialect != null)
|
||||
? new SQLErrorCodeSQLExceptionTranslator(dialect.name())
|
||||
: new SQLStateSQLExceptionTranslator();
|
||||
|
||||
ctx.exception(translator.translate("jOOQ", ctx.sql(), ctx.sqlException()));
|
||||
ctx.exception(translator.translate("jOOQ", ctx.sql(), ctx.sqlException()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user