Skip to content

Commit 0dfa36b

Browse files
authored
Handle ZXingError class in iOS wrapper (zxing-cpp#877)
ios: Handle all errors by catching exceptions of any type (save guard against crash)
1 parent 11d12b5 commit 0dfa36b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wrappers/ios/Sources/Wrapper/Reader/ZXIBarcodeReader.mm

+3
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ - (instancetype)initWithOptions:(ZXIReaderOptions*)options{
146146
} catch(std::exception &e) {
147147
SetNSError(error, ZXIReaderError, e.what());
148148
return nil;
149+
} catch (...) {
150+
SetNSError(error, ZXIReaderError, "An unknown error occurred");
151+
return nil;
149152
}
150153
}
151154

0 commit comments

Comments
 (0)