diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-10-03 12:21:13 -0400 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2017-10-03 12:21:13 -0400 |
commit | 21fe8117d63ea0f7503a3779287f1c42fcbb1e4e (patch) | |
tree | c6f2f598cf71c09fc0eab4ca50454a802a684f5c | |
parent | 9eaed012dd33b34758582907100ba748a850ca9f (diff) | |
download | qtlocation-mapboxgl-21fe8117d63ea0f7503a3779287f1c42fcbb1e4e.tar.gz |
[ios, macos] Throw an exception when the snapshotter has already started.
-rw-r--r-- | platform/darwin/src/MGLMapSnapshotter.mm | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLMapSnapshotter.mm b/platform/darwin/src/MGLMapSnapshotter.mm index edc6aaf00d..5901f36e5d 100644 --- a/platform/darwin/src/MGLMapSnapshotter.mm +++ b/platform/darwin/src/MGLMapSnapshotter.mm @@ -110,13 +110,8 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; - (void)startWithQueue:(dispatch_queue_t)queue completionHandler:(MGLMapSnapshotCompletionHandler)completion; { if ([self isLoading]) { - NSString *errorMessage = NSLocalizedStringWithDefaultValue(@"ALREADY_STARTED_SNAPSHOTTER", nil, nil, @"Already started this snapshotter", "User-friendly error description"); - NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errorMessage}; - NSError *error = [NSError errorWithDomain:MGLErrorDomain code:1 userInfo:userInfo]; - dispatch_async(queue, ^{ - completion(nil, error); - }); - return; + [NSException raise:@"MGLAlreadyStartedSnapshotterException" + format:@"Already started this snapshotter."]; } _loading = true; |