Handling errors returned from the server

Each of the Route360° web services take a success and error callback function as parameters. Since we also support older version if Internet Explorer we issue all our requests via JSONP. Unfortuneatly this makes it very hard to catch server side errors or exceptions. We walkaround this limitation by returning a 200 Request Ok and return a JSON Object that looks like this: { data : [], status : "", message : "" }. We can the evaluate the given errors at least after the timeout defined for the jQuery.ajax() call. The currently possbile error codes are:

service-not-available

This exceptions happens if the hole Route360° web service is not available. This might be due to a service restart/update or a complete outage. We are closely monitoring our service availablity, so should you receive this message for longer than a short period of minutes and you are sure you configured the service url correct, please don't hesitate to contact us.

no-route-found

This exception is thrown if there is no route between a given source and target point. This can happen, if for example the target point is on an island and therefore no direct connection to the main network exists.

travel-time-exceeded

This exception happens if the travel time between a given source and target point exceeds the server side limitation of 12 hours.

wrong-configuration

This exception is thrown if the configuration of each service is incorrect, for example if a travel type that is not supported or a transit date not covered by the server is given.

could-not-connect-point-to-network

The service connects the given source and target points to the underlying OSM network. Therefore we calculate the closest edge to the given point that matches the given travel type. If we can't find such an edge this exception is returned.

The code should produce the following error message:

service-not-available: The routing service is currently not available, please try again later.

Handling errors returned from the server

Intercept and interpret error messages from route360

GET YOUR FREE API KEY to use this example
reload
open in new tab
show code