feat: refactor error handling to use custom_errors.LoaderError for improved error management

This commit is contained in:
2026-04-10 19:35:38 -05:00
parent 9493a2d32f
commit eb3c3bbfce
5 changed files with 9 additions and 132 deletions

View File

@@ -25,7 +25,7 @@ func loadRowsPostgres(
tableInfo config.TargetTableInfo,
columns []models.ColumnType,
chChunksIn <-chan models.Chunk,
chErrorsOut chan<- LoaderError,
chErrorsOut chan<- custom_errors.LoaderError,
chJobErrorsOut chan<- custom_errors.JobError,
wgActiveChunks *sync.WaitGroup,
rowsLoaded *int64,
@@ -61,7 +61,7 @@ func loadChunkPostgres(
identifier pgx.Identifier,
colNames []string,
chunk models.Chunk,
chErrorsOut chan<- LoaderError,
chErrorsOut chan<- custom_errors.LoaderError,
chJobErrorsOut chan<- custom_errors.JobError,
wgActiveChunks *sync.WaitGroup,
rowsLoaded *int64,
@@ -92,7 +92,7 @@ func loadChunkPostgres(
}
select {
case chErrorsOut <- LoaderError{Chunk: chunk, Msg: err.Error()}:
case chErrorsOut <- custom_errors.LoaderError{Chunk: chunk, Msg: err.Error()}:
case <-ctx.Done():
return true
}