fix_bug_switch: add CompileException

This commit is contained in:
nickAS21 2023-06-12 19:00:59 +03:00
parent f534e2db64
commit 7f0c5f219b

View File

@ -183,11 +183,13 @@ public class DefaultTbelInvokeService extends AbstractScriptInvokeService implem
lock.unlock(); lock.unlock();
} }
return scriptId; return scriptId;
} catch (Exception e) { } catch (CompileException ce) {
if (((CompileException) e).getExpr() != null && new String(((CompileException) e).getExpr()).contains(tbelSwitch)) { if ( ce.getExpr() != null && new String(ce.getExpr()).contains(tbelSwitch)) {
e = new CompileException(tbelSwitchErrorMsg, ((CompileException) e).getExpr(), ((CompileException) e).getCursor(), e.getCause()); ce = new CompileException(tbelSwitchErrorMsg, ce.getExpr(), ce.getCursor(), ce.getCause());
} }
throw new TbScriptException(scriptId, TbScriptException.ErrorCode.COMPILATION, scriptBody, e); throw new TbScriptException(scriptId, TbScriptException.ErrorCode.COMPILATION, scriptBody, ce);
} catch (Exception e) {
throw new RuntimeException(e);
} }
}); });
} }