Webcore - variable deletion did not flag an obvious error

@nh.schottfam
I had a difficult time finding my error that is now clearly obvious.
I erased a defined variable in a piston. I had used it in an Expression. I missed removing it from that Expression. The only flag for the error was within the Expression statement and I did not see it until after lots of debugging. Any way to flag that error so that it is more obvious/visible?

1 Like

Yeah, I've been there. Expressions seem to only be evaluated at runtime, or in the expression editor like you show.

I did a quick test, and it does make an info log for the piston in Hubitat logs, and in the miminal piston logs.

image

Nothing I would ever notice in Hubitat logs, though, coming through as info. I would expect a warn or exception.

The one thing I do when things aren't obvious is do a full piston backup. You will see the errant pistons in the logs during the backup; like missing vars in pistons you didn't realize used that global.

1 Like

Good to know. Thanks. Missing local variables too?

Sorry, can't remember but I imagine so as the expressions don't seem to be exposed to any WebCore auto correction like changing a device name.

Some applications can handle the error of a variable not found in the piston.

So webCoRE will only log this as an error if the piston is at trace level or higher logging for the piston.

1 Like