refactor: implement Consume method in GenericLoader; enhance error handling in ProcessBatch

This commit is contained in:
2026-05-06 18:56:50 -05:00
parent f12937a1c3
commit 80babf24f2
2 changed files with 64 additions and 2 deletions

View File

@@ -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,