From 562a47e5ab79b9f65cf6d03f3fc812a892aa9bb7 Mon Sep 17 00:00:00 2001 From: villberg Date: Tue, 26 Aug 2014 05:33:19 +0000 Subject: [PATCH] refs #5223 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30133 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/representation/expressions/Expression.java | 6 +----- .../simantics/sysdyn/representation/utils/UnitUtils.java | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) 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 b4122296..48ac5957 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 @@ -81,11 +81,7 @@ public abstract class Expression implements IExpression { @Override public String validateUnits(ReadGraph graph, SysdynModel model) { - try { - return UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), getExpression()); - } catch (TokenMgrError e) { - return e.getMessage(); - } + return UnitUtils.matchUnits(graph, model, parent.getParentConfiguration(), parent.getUnit(), getExpression()); } @Override diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/UnitUtils.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/UnitUtils.java index 8418b14f..66566c80 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/UnitUtils.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/representation/utils/UnitUtils.java @@ -35,6 +35,7 @@ import org.simantics.sysdyn.representation.Module; import org.simantics.sysdyn.representation.Shadow; import org.simantics.sysdyn.representation.Variable; import org.simantics.sysdyn.unitParser.ParseException; +import org.simantics.sysdyn.unitParser.TokenMgrError; import org.simantics.sysdyn.unitParser.UnitCheckingException; import org.simantics.sysdyn.unitParser.UnitCheckingNode; import org.simantics.sysdyn.unitParser.UnitParser; @@ -128,6 +129,8 @@ public class UnitUtils { } } catch (ParseException e) { return "Cannot validate units: Syntax error in expression."; + } catch (TokenMgrError e) { + return "Cannot validate units: Syntax error in expression."; } return null; } -- 2.47.1