"Split" ReaderException into subclasses to enable more useful error reporting
[zxing.git] / core / src / com / google / zxing / multi / qrcode / detector / MultiDetector.java
index 8ce4d43..d3797d9 100644 (file)
 
 package com.google.zxing.multi.qrcode.detector;
 
-import com.google.zxing.ReaderException;
-import com.google.zxing.common.DetectorResult;
+import com.google.zxing.FormatException;
+import com.google.zxing.NotFoundException;
 import com.google.zxing.common.BitMatrix;
+import com.google.zxing.common.DetectorResult;
 import com.google.zxing.qrcode.detector.Detector;
 import com.google.zxing.qrcode.detector.FinderPatternInfo;
 
@@ -40,20 +41,20 @@ public final class MultiDetector extends Detector {
     super(image);
   }
 
-  public DetectorResult[] detectMulti(Hashtable hints) throws ReaderException {
+  public DetectorResult[] detectMulti(Hashtable hints) throws NotFoundException {
     BitMatrix image = getImage();
     MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image);
     FinderPatternInfo[] info = finder.findMulti(hints);
 
     if (info == null || info.length == 0) {
-      throw ReaderException.getInstance();
+      throw NotFoundException.getNotFoundInstance();
     }
 
     Vector result = new Vector();
     for (int i = 0; i < info.length; i++) {
       try {
         result.addElement(processFinderPatternInfo(info[i]));
-      } catch (ReaderException e) {
+      } catch (FormatException e) {
         // ignore
       }
     }