add missing inc error

This commit is contained in:
Ahrav Dutta 2024-10-28 11:59:06 -07:00
parent f6236eefe3
commit 744c9f367c

View file

@ -105,6 +105,7 @@ func (h *defaultHandler) handleNonArchiveContent(
for data := range chunkReader(ctx, reader) {
dataOrErr := DataOrErr{}
if err := data.Error(); err != nil {
h.metrics.incErrors()
dataOrErr.Err = fmt.Errorf("%w: error reading chunk: %v", ErrProcessingWarning, err)
if writeErr := common.CancellableWrite(ctx, dataOrErrChan, dataOrErr); writeErr != nil {
return fmt.Errorf("%w: error writing to data channel: %v", ErrProcessingFatal, writeErr)