wrapError method
Adapters override to map driver errors (unique violations, ...).
Implementation
@override
QueryException wrapError(Object error, String sql, List<Object?> bindings) {
if (error is pg.ServerException && error.code == '23505') {
return UniqueConstraintException(
error.message,
sql: sql,
bindings: bindings,
cause: error,
);
}
return super.wrapError(error, sql, bindings);
}