maplibre-native
maplibre-native copied to clipboard
MLNStyle `addSource` throws NSException instead of returning NSError
Describe the bug
Adding source via MLNStyle.addSource()
twice causes MLNRedundantSourceIdentifierException
to be thrown. Since this is an Objective-C exception, AFAIK it is impossible to catch it from Swift without additional tooling in ObjC, ultimately causing my Flutter app to crash.
To Reproduce Steps to reproduce the behavior:
- Call
MLNStyle.addSource()
twice for the same source from Swift - NSException is thrown which cannot be handled directly in Swift
Expected behavior NSError should be returned so it can be properly handled.
Platform information (please complete the following information):
- OS: iOS
- Platform iOS
- Version 16.7.4