Topic: Could not find token at index 0 in NextTokenCore
OpenRouteService is unavailable/unstable today and calling
public static OnlineMapsOpenRouteServiceGeocodingResult GetResult(string response)throws an exception.
How can I handle it the best way? The Deserialize method should check the json schema before trying to parse tokens from it.
Full stack trace:
Exception: Could not find token at index 0.
OnlineMapsJSON.NextTokenCore () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:314)
OnlineMapsJSON.LookAhead () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:199)
OnlineMapsJSON.ParseValueDirect () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:673)
OnlineMapsJSON.ParseDirect (System.String json) (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:336)
OnlineMapsJSON.Deserialize[T] (System.String json) (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:38)
OnlineMapsOpenRouteServiceGeocode.GetResult (System.String response) (at Assets/Infinity Code/Online maps/Scripts/WebServices/OnlineMapsOpenRouteServiceGeocode.cs:68)
RenderPoiPopupSystem.OnGeocodingComplete (System.String response) (at Assets/Fenix/Scripts/GUI/Systems/RenderPoiPopupSystem.cs:234)
OnlineMapsTextWebService.OnRequestComplete (OnlineMapsWWW www) (at Assets/Infinity Code/Online maps/Scripts/WebServices/Base/OnlineMapsTextWebService.cs:69)
OnlineMapsWWW.Finish () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:373)
OnlineMapsWWW+<WaitResponse>d__61.MoveNext () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:526)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <55fbbbd17b724c15b6abe8c1a3e3289c>:0)json is equal to:
HTTP/1.1 502 Bad Gatewaybut Deserialize method expects it to look like this:
{
"session": "AJVsH2wdunNFKvFLUhPBXzimpjU4JRrRN5fCYqV57jKTq2UEtOZcx8JamlCEElbYVd_bqWdJzQxz_G57-Bj965QMVUpKPNwbrQGA7TyzcRrydyYhwpSYq7WLg6rGO_59B6ZrXlDLi5H6uuevPTAOmfryJe6q65ot0JHcUQCrkHDkielIAujzm-wloxzO-dmQQuvXahdmppHqKVU",
"expiry": "1720776256",
"tileWidth": 256,
"imageFormat": "png",
"tileHeight": 256
}