[#7909] ExecuteContext.sqlException(SQLException) should accept null
This commit is contained in:
parent
3d1d17ec7d
commit
f2eea03c55
@ -292,6 +292,9 @@ public interface ExecuteContext extends Scope {
|
||||
* {@link DataAccessException}. To have jOOQ throw your own custom
|
||||
* {@link RuntimeException}, use {@link #exception(RuntimeException)}
|
||||
* instead. This may have no effect, if called at the wrong moment.
|
||||
* <p>
|
||||
* If <code>null</code> is being passed, jOOQ will internally translate the
|
||||
* "unavailable" exception to an unspecified {@link DataAccessException}.
|
||||
*/
|
||||
void sqlException(SQLException e);
|
||||
|
||||
|
||||
@ -2425,8 +2425,10 @@ final class Tools {
|
||||
* Translate a {@link SQLException} to a {@link DataAccessException}
|
||||
*/
|
||||
static final DataAccessException translate(String sql, SQLException e) {
|
||||
String message = "SQL [" + sql + "]; " + e.getMessage();
|
||||
return new DataAccessException(message, e);
|
||||
if (e != null)
|
||||
return new DataAccessException("SQL [" + sql + "]; " + e.getMessage(), e);
|
||||
else
|
||||
return new DataAccessException("SQL [" + sql + "]; Unspecified SQLException");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user