summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2017-10-03 12:21:13 -0400
committerFabian Guerra <fabian.guerra@mapbox.com>2017-10-03 12:21:13 -0400
commit21fe8117d63ea0f7503a3779287f1c42fcbb1e4e (patch)
treec6f2f598cf71c09fc0eab4ca50454a802a684f5c
parent9eaed012dd33b34758582907100ba748a850ca9f (diff)
downloadqtlocation-mapboxgl-21fe8117d63ea0f7503a3779287f1c42fcbb1e4e.tar.gz
[ios, macos] Throw an exception when the snapshotter has already started.
-rw-r--r--platform/darwin/src/MGLMapSnapshotter.mm9
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;