Skip to content

Commit

Permalink
Align parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
robmathers committed Oct 17, 2019
1 parent b404d90 commit 369aff3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions WhereAmI/OpenCageAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ - (void)sendGeoCodeRequestWithLatitude:(double)latitude
NSInteger statusCode = ((NSHTTPURLResponse *)response).statusCode;
if (statusCode == 402) {
NSError *quotaError = [NSError errorWithDomain:@"OpenCageAPIError"
code:402
userInfo:@{NSLocalizedDescriptionKey: @"OpenCage API quota exceeded."}
code:402
userInfo:@{NSLocalizedDescriptionKey: @"OpenCage API quota exceeded."}
];
completionHandler(nil, quotaError);
return;
}
else if (statusCode == 403) {
NSError *suspendedError = [NSError errorWithDomain:@"OpenCageAPIError"
code:403
userInfo:@{NSLocalizedDescriptionKey: @"OpenCage API key suspended."}
code:403
userInfo:@{NSLocalizedDescriptionKey: @"OpenCage API key suspended."}
];
completionHandler(nil, suspendedError);
return;
}
else if (statusCode != 200) {
NSError *unknownAPIError = [NSError errorWithDomain:@"OpenCageAPIError"
code:statusCode
code:statusCode
userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"OpenCage API error. Code %ld. See https://opencagedata.com/api#codes for more information.", (long)statusCode]}
];
completionHandler(nil, unknownAPIError);
Expand Down

0 comments on commit 369aff3

Please sign in to comment.