Compare commits

..

2 Commits

Author SHA1 Message Date
2754c14fa6 Merge pull request 'fix: don't fatal while process dir' (#52) from fix/fatal-dir into master
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Reviewed-on: #52
2022-12-09 10:17:59 +00:00
8858ff37ad
fix: don't fatal while process dir
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-09 18:15:40 +08:00

View File

@ -158,9 +158,14 @@ func (p *processor) processDir(inputDir string) error {
}
filePath := filepath.Join(inputDir, item.Name())
err := p.processFile(filePath)
if err != nil {
logger.Error("conversion failed", zap.String("source", filePath), zap.Error(err))
allDec := common.GetDecoder(filePath, p.skipNoopDecoder)
if len(allDec) == 0 {
logger.Info("skipping while no suitable decoder", zap.String("source", item.Name()))
continue
}
if err := p.process(filePath, allDec); err != nil {
logger.Error("conversion failed", zap.String("source", item.Name()), zap.Error(err))
}
}
return nil