mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
[automation] Improve rule debugging (#1742)
* Add rule UID to error message * Add exception with stacktrace when debug level is enabled Related to #1734 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ public abstract class AbstractScriptModuleHandler<T extends Module> extends Base
|
||||
private final String type;
|
||||
protected final String script;
|
||||
|
||||
private final String ruleUID;
|
||||
protected final String ruleUID;
|
||||
|
||||
public AbstractScriptModuleHandler(T module, String ruleUID, ScriptEngineManager scriptEngineManager) {
|
||||
super(module);
|
||||
|
||||
+2
-1
@@ -62,7 +62,8 @@ public class ScriptActionHandler extends AbstractScriptModuleHandler<Action> imp
|
||||
Object result = scriptEngine.eval(script);
|
||||
resultMap.put("result", result);
|
||||
} 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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user