From 41736e4600ae0314c039ec7b931491f132af9999 Mon Sep 17 00:00:00 2001 From: Quentin Machu Date: Tue, 9 Feb 2016 23:25:48 -0500 Subject: [PATCH] worker: DetectData should return an error if the supported detector failed --- worker/detectors/data.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worker/detectors/data.go b/worker/detectors/data.go index 4e3f96b5..011d067c 100644 --- a/worker/detectors/data.go +++ b/worker/detectors/data.go @@ -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 } }