[automation] Improve logging in ScriptConditionHandler (#4192)

Fixes #4179.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
pull/4185/head
Florian Hotze 2024-04-21 10:16:03 +02:00 committed by GitHub
parent a79a9c651b
commit b9940d6687
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -60,10 +60,12 @@ public class ScriptConditionHandler extends AbstractScriptModuleHandler<Conditio
if (returnVal instanceof Boolean boolean1) {
result = boolean1;
} else {
logger.error("Script did not return a boolean value, but '{}'", returnVal);
logger.error("Script of rule with UID '{}' did not return a boolean value, but '{}'", ruleUID,
returnVal);
}
} catch (ScriptException e) {
logger.error("Script execution failed: {}", e.getMessage());
logger.error("Script execution of rule with UID '{}' failed: {}", ruleUID, e.getMessage(),
logger.isDebugEnabled() ? e : null);
}
}