[jOOQ/jOOQ#14701] Let DataAccessException::sqlStateClass be based on SQL Server error codes for SQLStateClass 22 or 23
This commit is contained in:
parent
5ebcc5c053
commit
94af3fdd98
@ -45,6 +45,8 @@ import java.sql.SQLIntegrityConstraintViolationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
// ...
|
||||
|
||||
import io.r2dbc.spi.R2dbcException;
|
||||
|
||||
/**
|
||||
@ -139,6 +141,22 @@ public class DataAccessException extends RuntimeException {
|
||||
*/
|
||||
@NotNull
|
||||
public static SQLStateClass sqlStateClass(SQLException e) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (e.getSQLState() != null)
|
||||
return SQLStateClass.fromCode(e.getSQLState());
|
||||
else if (e.getSQLState() == null && "org.sqlite.SQLiteException".equals(e.getClass().getName()))
|
||||
|
||||
@ -40,6 +40,8 @@ package org.jooq.exception;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
// ...
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@ -198,4 +200,52 @@ public enum SQLStateClass {
|
||||
|
||||
return SQLStateClass.OTHER;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user