Skip to content

Commit

Permalink
Merge branch 'StartupMakers-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Per Liedman committed Dec 28, 2016
2 parents 09fd4c8 + 746c5d1 commit 5c2b297
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lrm-graphhopper",
"version": "1.1.2",
"version": "1.1.3",
"description": "Support for GraphHopper in Leaflet Routing Machine",
"main": "src/L.Routing.GraphHopper.js",
"scripts": {
Expand All @@ -23,7 +23,6 @@
"bugs": "https://github.com/perliedman/lrm-graphhopper/issues",
"dependencies": {
"corslite": "0.0.6",
"leaflet": "^0.7.3",
"polyline": "0.0.3"
},
"browserify-shim": {
Expand Down
11 changes: 10 additions & 1 deletion src/L.Routing.GraphHopper.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,18 @@
data = JSON.parse(resp.responseText);
this._routeDone(data, wps, callback, context);
} else {
var finalResponse;
var responseText = err && err.responseText;
try {
finalResponse = JSON.parse(responseText);
} catch (e) {
finalResponse = responseText;
}

callback.call(context || callback, {
status: -1,
message: 'HTTP request failed: ' + err
message: 'HTTP request failed: ' + err,
response: finalResponse
});
}
}
Expand Down

0 comments on commit 5c2b297

Please sign in to comment.