Skip to content

Commit 7a13222

Browse files
committed
fix MacOS leftover error codes
1 parent 6f52207 commit 7a13222

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

macos/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,9 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
484484

485485
if error != nil {
486486
DispatchQueue.main.async {
487-
// TODO: fix error code
488-
result(FlutterError(code: "MobileScanner", message: error?.localizedDescription, details: nil))
487+
result(FlutterError(
488+
code: MobileScannerErrorCodes.BARCODE_ERROR,
489+
message: error?.localizedDescription, details: nil))
489490
}
490491
return
491492
}
@@ -510,10 +511,11 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
510511
}
511512

512513
try imageRequestHandler.perform([barcodeRequest])
513-
} catch let e {
514-
// TODO: fix error code
514+
} catch let error {
515515
DispatchQueue.main.async {
516-
result(FlutterError(code: "MobileScanner", message: e.localizedDescription, details: nil))
516+
result(FlutterError(
517+
code: MobileScannerErrorCodes.BARCODE_ERROR,
518+
message: error.localizedDescription, details: nil))
517519
}
518520
}
519521
}

0 commit comments

Comments
 (0)