My widget sometimes shows this error message:
It’s German, I think in English it means something like: Request timed out.
The strange thing is that the widget sometimes does exactly what it should do and sometimes this Error occurs.
Since the Error-Log in Scriptable doesn’t show a line where the error happened I think it’s in general a Scriptable problem.
Does anyone know what exactly went wrong causing this error?
Or would it help to have the script? Since I think it’s a Scriptable-General error I don’t post ist yet, because it’s a quite long script and not very elegant written, more like a throwing together of multiple example scripts…
I don’t want anyone to waste his time with this if it’s a general problem, but if you mean ist script-specific I will post it off course.
I sometimes see this when my widget fails to fetch data from my web service. Eg. when in airplane mode, or trying to access a LAN internal resource when on the cell network.
Could also be an unhandled error or a called web service/API timing out.
Lots of possibilities. I’d consider logging to file so when it occurs you can start narrowing down where the issue is occurring.
When trying to access a LAN internal resource while being on the cell network this error occurs often, but this time this isn’t the reason.
I now know that the error occurs only if I try to fetch “big” data with about 30K, looks like this is failing sometimes.
I had set the timeout to 0.2 seconds, and while this worked great for data less than 1K this could be not enough for data with 30K.
The idea of logging to a file to see when exactly the error occurs is a good idea, I will try this and hopefully than give you more information!
There’s no reason to set such a short timeout unless you really want the response within that time, good or bad. Otherwise just give it some slack. 5 seconds or 10 - who cares in a widget which only is updated every 20 minutes anyway?..
With a timeout of 1 sec all is working perfectly.
Thanks for your help pointing me to the right direction!