Page 1 of 1
My geo location flow stoped working correctly. Strange error
Posted: 25 Jul 2018 15:23
by lord_EarlGray
Hi, I have created flow to show mu current geo location on statusbar. It uses http request. All worked fine up today. Now I'm getting error each few runs on statusbar (picture) I don't know what does it mean and how to fix this flow to work correctly all the time. I think that maybe this error is caused by sme changes in reverse geo location API I'm using.
Flow and log are attached.
- log.txt
- (26.05 KiB) Downloaded 678 times
Re: My geo location flow stoped working correctly. Strange e
Posted: 26 Jul 2018 06:22
by Desmanto
The address url works fine. It seems to be the OSM server didn't respond with proper json as the result, probably server timeout or maybe you have queried too many times in a day. Try to put a debug dialog after the http request and check the content of the response. You need to add extra check, when the response is not a valid JSON type, it will produce error. Add another toast message from the http post and change the connection to exception. Stop the flow at there (or retry after certain period).
To reduce the frequency of the query, you can save the previous location. When the next check triggered, calculate the distance between current location vs previous location. If it is less than (let's say) 50 metres, then no need to query the geolocation.
Be careful, you are leaking your location from your log. Please edit your first post and remove the log (or censor the coordinate).