pelias / pelias-ios-sdk

Interact with Mapzen's search & geocoding service
https://mapzen.com/products/search/
Other
9 stars 9 forks source link

Create NSError if not valid geojson #75

Closed sarahsnow1 closed 7 years ago

sarahsnow1 commented 7 years ago

This PR updates the code to treat anything that isnt valid geojson like an http error. So this response:

meta =     {
        "status_code" = 429;
        version = 1;
    };
    results =     {
        error =         {
            message = "Queries per second exceeded: Queries exceeded (6 allowed).";
            type = QpsExceededError;
        };
    };

will be treated as if the http code 429 Too Many Requests was received. An NSError will be created with code 429 and description Queries per second exceeded: Queries exceeded (6 allowed).

It also only creates a parsed response if there is valid geojson