[jOOQ/jOOQ#15732] Better error message reverse engineering

This commit is contained in:
Lukas Eder 2024-06-17 12:41:33 +02:00
parent 7b12c4cf42
commit 4b3640f006

View File

@ -3633,11 +3633,13 @@ final class Tools {
case DUCKDB: {
String m = e.getMessage().toLowerCase();
if (m.contains("constraint violated: duplicate key"))
return new IntegrityConstraintViolationException("SQL [" + sql + "]; " + e.getMessage(), e);
else if (m.contains("constraint error: not null constraint failed"))
if (m.contains("constraint violated: duplicate key")
|| m.contains("constraint error: not null constraint failed")
|| m.contains("constraint error: check constraint failed"))
return new IntegrityConstraintViolationException("SQL [" + sql + "]; " + e.getMessage(), e);
}
break;
}
}