From 94390056af7fd9e2e159910ddbc643cfe0e0ee81 Mon Sep 17 00:00:00 2001 From: villberg Date: Mon, 25 Aug 2014 16:20:10 +0000 Subject: [PATCH] refs #5223 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30130 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/representation/expressions/Expression.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java index 7463bfcc..b4122296 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/expressions/Expression.java @@ -20,6 +20,7 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.manager.SysdynModel; import org.simantics.sysdyn.representation.IndependentVariable; import org.simantics.sysdyn.representation.utils.UnitUtils; +import org.simantics.sysdyn.unitParser.TokenMgrError; /** * Abstract class for any expression @@ -80,7 +81,11 @@ public abstract class Expression implements IExpression { @Override public String validateUnits(ReadGraph graph, SysdynModel model) { - return UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), getExpression()); + try { + return UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), getExpression()); + } catch (TokenMgrError e) { + return e.getMessage(); + } } @Override -- 2.47.1