Status code 202

7 posts / 0 new
Last post
bikerfab
Status code 202

Hello,

I'm using MQ directions API, from time to time I get a response with code 202 (route.routeError.errorCode) and the shape object is undefined, but code 202 is not listed here:

https://www.mapquestapi.com/search/status-codes.html

Can you tell me the reason of this error ?

 

Thanks

Fabio

 

 


MQBrianCoakley
Can you post a request that
Can you post a request that returns a 202?

bikerfab
http://www.mapquestapi.com

http://www.mapquestapi.com/directions/v2/route?key=my_hey&ambiguities=ig...{locations:["45.07933920973809,10.232391357421875","45.00170912094224,10.682830810546875"],options:{disallows:[Toll road, Unpaved],avoidTimedConditions:false,doReverseGeocode:false,shapeFormat:raw,generalize:0,routeType:bicycle,timeType:0,unit:k,narrativeType:"none"}}

 

 

 

 


MQBrianCoakley
The routeError node was not
The routeError node was not intended to be returned by the general api. It is an internal message for the MapQuest.com router. There is no information or documentation about that error code. The statusCode is the one related to the url posted above. Sorry for any confusion.

bikerfab
ok thaks for the explanation,

ok thaks for the explanation, but there is still and issue.

When routeError code is 202 the shape member of the data structure is undefined and the subsequent calls of my code that use shape.shapePoints fail:

here you have the response data structure (sorry for bad formatting):

Object {hasTollRoad: false, hasBridge: false, computedWaypoints: Array[0], fuelUsed: 0, hasTunnel: false…}computedWaypoints: Array[0]distance: 0 formattedTime: "00:00:00"fuelUsed: 0hasBridge: falsehasCountryCross: falsehasFerry: falsehasHighway: falsehasSeasonalClosure: falsehasTollRoad: falsehasTunnel: falsehasUnpaved: false legs: Array[0] locationSequence: Array[2]locations: Array[2]options: ObjectrealTime: -1routeError: ObjecterrorCode: 202message: ""__proto__: ObjectsessionId: ""time: 0__proto__: Object

 

This is a query that does not show the issue:

http://www.mapquestapi.com/directions/v2/route?key=.....…e&outFormat=json&inFormat=json&callback=renderMQDirections&json={locations:["44.80230124552821,10.323028564453125","44.83237825610345,10.348777770996094"],options:{disallows:[Toll road, Unpaved],avoidTimedConditions:false,doReverseGeocode:false,shapeFormat:raw,generalize:0,routeType:bicycle,timeType:0,unit:k,narrativeType:"none"}}

and the response is:

Object {hasTollRoad: false, hasBridge: false, computedWaypoints: Array[0], fuelUsed: 0, shape: Object…}boundingBox: ObjectcomputedWaypoints: Array[0]distance: 5.195 formattedTime: "00:15:42"fuelUsed: 0hasBridge: falsehasCountryCross: falsehasFerry: falsehasHighway: falsehasSeasonalClosure: falsehasTollRoad: falsehasTunnel: truehasUnpaved: false legs: Array[1] locationSequence: Array[2]locations: Array[2]options: ObjectrealTime: -1routeError: ObjecterrorCode: -400message: ""__proto__: ObjectsessionId: "57d175ec-016b-0002-02b7-0e3e-00163ec01eda"shape: Objecttime: 942__proto__: Object

You can see that the failing request reports distance=0 while the correct one reports 5.195km (correct value), the time is 0 and legs is Array[0] for failing, not zero for correct response (fields hilighted in bold).

Thanks again

Fabio

 

 


MQBrianCoakley
The issue is that the route
The issue is that the route can not be calculated and returns the 602 status code. The route is not calculated when the Unpaved road type is disallowed. It looks like the destination is on a road type indicating it's unpaved. I will forward this on to the development team to assess.

bikerfab
I accurately checked again

I accurately checked again the destination point (45.00170912094224,10.682830810546875) of the failing request ad it is actually on an unpaved area (seems no road at all). My application gets user input by manual point-and-click and this may lead to inaccurate locations, so I should manage this situation when unpaved is disallowed.

Thank you very much for your help,

Fabio