@Test
public void exceptionInJsThrowsException() throws TbNodeException, ScriptException {

    initWithScript();
    TbMsgMetaData metaData = new TbMsgMetaData();
    TbMsg msg = new TbMsg(UUIDs.timeBased(), "USER", null, metaData, "{}", ruleChainId, ruleNodeId, 0L);
    mockJsExecutor();
    when(scriptEngine.executeFilter(msg)).thenThrow(new ScriptException("error"));
    node.onMsg(ctx, msg);
    verifyError(msg, "error", ScriptException.class);
}