MKuranowski/WarsawGTFS

Brigades - reoccuring issue

Opened this issue · 1 comments

The script sometimes crashes with the following:

Failed to parse API response:     {"result":"B\u0142\u0119dna metoda lub parametry wywo\u0142ania"}
json: cannot unmarshal string into Go struct field .Result of type []struct { Values []struct { Key string; Value string } }

Maybe we could also implement backoff in such a case?

When that error occurs - based on my observations - usually it is enough to fetch again the same url. Second (or the third in worst case) fetch should work. If not, probably it is a global issue with whole service.

So the solution could be a small recursive function recursiveFetch(url, limit) starting from eg. limit=3 and going down if fetch returns error.