What does this Error Mean


#1

I have a piston that has been working reliably but today it gave me this.

4/12/2019, 9:00:00 PM +33ms
+692ms ║An error occurred while executing the event: java.lang.reflect.UndeclaredThrowableException

What does this mean, and how can I find out how to fix it? Or, has something been going on with ST tht caused this problem?


#2

Tony

Would help if you posted the green piston snapshot.

This error could be any number of things.


#3

OK, here you go. It seems this error has just started, and it is definitely not repeatable.

Here are the logs that shows the problem.

4/13/2019, 9:44:30 PM +192ms
+1621ms ║Living Rm Bulb OFF
4/13/2019, 6:22:59 PM +172ms
+410ms ║Living Rm Light is ON after 1 Attempt to Turn On Cloudy
4/13/2019, 6:07:01 PM +274ms
+684ms ║Family Rm Light is ON after 1 Attempt to Turn On Cloudy
4/12/2019, 9:30:30 PM +249ms
+6083ms ║Living Rm Bulb OFF
4/12/2019, 6:21:00 PM +312ms
+475ms ║An error occurred while executing the event: java.lang.reflect.UndeclaredThrowableException
4/12/2019, 6:05:01 PM +192ms
+821ms ║Family Rm Light is ON after 1 Attempt to Turn On Cloudy
4/12/2019, 1:58:30 AM +169ms
+1069ms ║Living Rm Bulb OFF
4/11/2019, 6:59:00 PM +440ms
+406ms ║Living Rm Light is ON after 1 Attempt to Turn On Mostly Cloudy


#4

Yeah, the new weather API throws that error from time to time… out of our control I’m afraid.

Few suggestions:

  • Stop polling the API every 2 minutes! It puts excessive load on the servers and if lots of people did that (which unfortunately they do) it has a negative effect on anyone. The weather is not so accurate that a reported change to “cloudy” 1 minute ago is actually reflected in real life requiring an instant response.

  • add restriction to skip the piston execution when an error is present i.e:
    only when {contains( curCondition, “error”)} is equal to “false”


#5

Both excellent points, thanks. I still want to poll for the lights every 2 min but I do not need to poll the weather that often. I’ll change it. Testing for that error condition is a good idea.


#6

You may already know this…

If you hard code the $twcweather in the define section, it will end up polling the weather each time a trigger fires. Sometimes I use a piston dedicated to gathering weather data each hour, and storing certain datapoints into global variables. That way, your piston above can query the global as often as you want, without spamming the weather servers.


#7

Yes, thanks, I’m in the middle of doing exactly that. I did not think about the impact on the servers for my frequent accesses of the weather info, so I’m now fixing that situation.