worker: DetectData should return an error if the supported detector failed

This commit is contained in:
Quentin Machu 2016-02-09 23:25:48 -05:00 committed by Jimmy Zelinskie
parent 4478f40ef1
commit 41736e4600

View File

@ -93,9 +93,11 @@ func DetectData(path string, format string, toExtract []string, maxFileSize int6
for _, detector := range dataDetectors {
if detector.Supported(path, format) {
if data, err = detector.Detect(layerReader, toExtract, maxFileSize); err == nil {
return data, nil
data, err = detector.Detect(layerReader, toExtract, maxFileSize)
if err != nil {
return nil, err
}
return data, nil
}
}