fix: enhance error handling in extractor and loader processes; ensure proper job error propagation and logging
This commit is contained in:
@@ -247,24 +247,28 @@ func (mssqlEx *MssqlExtractor) Exec(
|
||||
|
||||
if err != nil {
|
||||
var exError *custom_errors.ExtractorError
|
||||
var jobError *custom_errors.JobError
|
||||
if errors.As(err, &exError) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case chErrorsOut <- *exError:
|
||||
}
|
||||
}
|
||||
|
||||
var jobError *custom_errors.JobError
|
||||
if errors.As(err, &jobError) {
|
||||
} else if errors.As(err, &jobError) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case chJobErrorsOut <- *jobError:
|
||||
}
|
||||
} else {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case chErrorsOut <- custom_errors.ExtractorError{Partition: partition, Msg: err.Error()}:
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
wgActivePartitions.Done()
|
||||
|
||||
Reference in New Issue
Block a user