diff options
author | Jason Wray <friedbunny@users.noreply.github.com> | 2018-08-09 13:35:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 13:35:28 -0400 |
commit | ec7b920603299f66332df3b324ed481c732b3657 (patch) | |
tree | 4561cda90d0a1a75f84f72f3a077a6e6b954c92b /platform/darwin/src/MGLStyle.mm | |
parent | a378d6fc9b71d5a40750158c5f7c475669408052 (diff) | |
download | qtlocation-mapboxgl-ec7b920603299f66332df3b324ed481c732b3657.tar.gz |
[ios] Standardize exception definitions
Diffstat (limited to 'platform/darwin/src/MGLStyle.mm')
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index e0415c02f7..88499cf9bb 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -55,6 +55,12 @@ #import "NSImage+MGLAdditions.h" #endif +const MGLExceptionName MGLInvalidStyleURLException = @"MGLInvalidStyleURLException"; +const MGLExceptionName MGLRedundantLayerException = @"MGLRedundantLayerException"; +const MGLExceptionName MGLRedundantLayerIdentifierException = @"MGLRedundantLayerIdentifierException"; +const MGLExceptionName MGLRedundantSourceException = @"MGLRedundantSourceException"; +const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSourceIdentifierException"; + /** Model class for localization changes. */ @@ -210,7 +216,7 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, try { [source addToMapView:self.mapView]; } catch (std::runtime_error & err) { - [NSException raise:@"MGLRedundantSourceIdentifierException" format:@"%s", err.what()]; + [NSException raise:MGLRedundantSourceIdentifierException format:@"%s", err.what()]; } } @@ -313,14 +319,14 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, MGLStyleLayer *sibling = layers.size() ? [self layerFromMBGLLayer:layers.at(0)] : nil; [styleLayer addToStyle:self belowLayer:sibling]; } catch (const std::runtime_error & err) { - [NSException raise:@"MGLRedundantLayerIdentifierException" format:@"%s", err.what()]; + [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } } else { try { MGLStyleLayer *sibling = [self layerFromMBGLLayer:layers.at(index)]; [styleLayer addToStyle:self belowLayer:sibling]; } catch (std::runtime_error & err) { - [NSException raise:@"MGLRedundantLayerIdentifierException" format:@"%s", err.what()]; + [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } } } @@ -402,7 +408,7 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, try { [layer addToStyle:self belowLayer:nil]; } catch (std::runtime_error & err) { - [NSException raise:@"MGLRedundantLayerIdentifierException" format:@"%s", err.what()]; + [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } [self didChangeValueForKey:@"layers"]; } @@ -431,7 +437,7 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, try { [layer addToStyle:self belowLayer:sibling]; } catch (std::runtime_error & err) { - [NSException raise:@"MGLRedundantLayerIdentifierException" format:@"%s", err.what()]; + [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } [self didChangeValueForKey:@"layers"]; } @@ -473,14 +479,14 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, try { [layer addToStyle:self belowLayer:nil]; } catch (std::runtime_error & err) { - [NSException raise:@"MGLRedundantLayerIdentifierException" format:@"%s", err.what()]; + [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } } else { MGLStyleLayer *sibling = [self layerFromMBGLLayer:layers.at(index + 1)]; try { [layer addToStyle:self belowLayer:sibling]; } catch (std::runtime_error & err) { - [NSException raise:@"MGLRedundantLayerIdentifierException" format:@"%s", err.what()]; + [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } } [self didChangeValueForKey:@"layers"]; |