]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions/osrm.js
Improve error handling for routing engines
[rails.git] / app / assets / javascripts / index / directions / osrm.js
index ab3bcff3605f36ee47173ba594512efadc4b3250..4a42d5dc96ea1e8d138c353afbd28824dc7bbdba 100644 (file)
@@ -84,12 +84,15 @@ function OSRMEngine() {
             steps.push([line[s[3]], s[0].split('-')[0], instText, s[2], line.slice(s[3], linesegend)]);
           }
 
-          callback(null, {
+          callback(false, {
             line: line,
             steps: steps,
             distance: data.route_summary.total_distance,
             time: data.route_summary.total_time
           });
+        },
+        error: function () {
+          callback(true);
         }
       });
     }