feat: refactor error handling to use custom_errors.LoaderError for improved error management
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user