refactor: implement Consume method in GenericLoader; enhance error handling in ProcessBatch
This commit is contained in:
@@ -38,8 +38,7 @@ func (gl *GenericLoader) ProcessBatch(
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
var pgErr *pgconn.PgError
|
||||
if errors.As(err, &pgErr) {
|
||||
if pgErr, ok := errors.AsType[*pgconn.PgError](err); ok {
|
||||
if pgErr.Code == "23505" {
|
||||
return 0, &custom_errors.JobError{
|
||||
ShouldCancelJob: true,
|
||||
|
||||
Reference in New Issue
Block a user