Showing
2 changed files
with
5 additions
and
7 deletions
| @@ -146,7 +146,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin { | @@ -146,7 +146,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin { | ||
| 146 | details: error)) | 146 | details: error)) |
| 147 | } catch { | 147 | } catch { |
| 148 | result(FlutterError(code: "MobileScanner", | 148 | result(FlutterError(code: "MobileScanner", |
| 149 | - message: "Unknown error occured..", | 149 | + message: "Unknown error occured.", |
| 150 | details: nil)) | 150 | details: nil)) |
| 151 | } | 151 | } |
| 152 | } | 152 | } |
| @@ -165,9 +165,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin { | @@ -165,9 +165,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin { | ||
| 165 | try mobileScanner.toggleTorch(call.arguments as? Int == 1 ? .on : .off) | 165 | try mobileScanner.toggleTorch(call.arguments as? Int == 1 ? .on : .off) |
| 166 | result(nil) | 166 | result(nil) |
| 167 | } catch { | 167 | } catch { |
| 168 | - result(FlutterError(code: "MobileScanner", | ||
| 169 | - message: "Called toggleTorch() while stopped!", | ||
| 170 | - details: nil)) | 168 | + result(FlutterError(code: "MobileScanner", message: error.localizedDescription, details: nil)) |
| 171 | } | 169 | } |
| 172 | } | 170 | } |
| 173 | 171 |
| @@ -279,7 +279,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -279,7 +279,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 279 | do { | 279 | do { |
| 280 | self.toggleTorchInternal(.on) | 280 | self.toggleTorchInternal(.on) |
| 281 | } catch { | 281 | } catch { |
| 282 | - result(FlutterError(code: error.localizedDescription, message: nil, details: nil)) | 282 | + result(FlutterError(code: "MobileScanner", message: error.localizedDescription, details: nil)) |
| 283 | return | 283 | return |
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| @@ -292,7 +292,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -292,7 +292,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 292 | let input = try AVCaptureDeviceInput(device: device) | 292 | let input = try AVCaptureDeviceInput(device: device) |
| 293 | captureSession.addInput(input) | 293 | captureSession.addInput(input) |
| 294 | } catch { | 294 | } catch { |
| 295 | - result(FlutterError(code: error.localizedDescription, message: nil, details: nil)) | 295 | + result(FlutterError(code: "MobileScanner", message: error.localizedDescription, details: nil)) |
| 296 | return | 296 | return |
| 297 | } | 297 | } |
| 298 | captureSession.sessionPreset = AVCaptureSession.Preset.photo | 298 | captureSession.sessionPreset = AVCaptureSession.Preset.photo |
| @@ -338,7 +338,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -338,7 +338,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 338 | try self.toggleTorchInternal(requestedTorchMode) | 338 | try self.toggleTorchInternal(requestedTorchMode) |
| 339 | result(nil) | 339 | result(nil) |
| 340 | } catch { | 340 | } catch { |
| 341 | - result(FlutterError(code: error.localizedDescription, message: nil, details: nil)) | 341 | + result(FlutterError(code: "MobileScanner", message: error.localizedDescription, details: nil)) |
| 342 | } | 342 | } |
| 343 | } | 343 | } |
| 344 | 344 |
-
Please register or login to post a comment