Skip to content

Commit

Permalink
- use Error.addInternalError instead of print in Matching.mo
Browse files Browse the repository at this point in the history
- minor changes in Initialization.mo 


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17856 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed Oct 23, 2013
1 parent fffe8b5 commit e234a04
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 60 deletions.
18 changes: 7 additions & 11 deletions Compiler/BackEnd/Initialization.mo
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ algorithm
then (stmts, leftCrs);

else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/Initialization.mo: function inlineWhenForInitializationWhenStmt failed"});
Error.addInternalError("./Compiler/BackEnd/Initialization.mo: function inlineWhenForInitializationWhenStmt failed");
then fail();

end matchcontinue;
Expand Down Expand Up @@ -999,7 +999,7 @@ algorithm
then (vars, eqs, b, dumpVars);

else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/Initialization.mo: function preBalanceInitialSystem1 failed"});
Error.addInternalError("./Compiler/BackEnd/Initialization.mo: function preBalanceInitialSystem1 failed");
then fail();
end matchcontinue;
end preBalanceInitialSystem1;
Expand Down Expand Up @@ -1217,7 +1217,7 @@ algorithm
then (eqns, var::dumpVars);

else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/Initialization.mo: function addStartValueEquations failed"});
Error.addInternalError("./Compiler/BackEnd/Initialization.mo: function addStartValueEquations failed");
then fail();
end matchcontinue;
end addStartValueEquations;
Expand Down Expand Up @@ -1587,7 +1587,6 @@ algorithm
Option<DAE.Exp> startValue;
DAE.Exp startValue_;
DAE.Exp startExp, bindExp;
String errorMessage;
BackendDAE.VarKind varKind;
HashSet.HashSet hs;

Expand Down Expand Up @@ -1733,12 +1732,11 @@ algorithm
then ((var, (vars, fixvars, eqns, hs)));

case ((var, _)) equation
errorMessage = "./Compiler/BackEnd/Initialization.mo: function collectInitialVars failed for: " +& BackendDump.varString(var);
Error.addMessage(Error.INTERNAL_ERROR, {errorMessage});
Error.addInternalError("./Compiler/BackEnd/Initialization.mo: function collectInitialVars failed for: " +& BackendDump.varString(var));
then fail();

else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/Initialization.mo: function collectInitialVars failed"});
Error.addInternalError("./Compiler/BackEnd/Initialization.mo: function collectInitialVars failed");
then fail();
end matchcontinue;
end collectInitialVars;
Expand Down Expand Up @@ -1817,7 +1815,6 @@ algorithm
BackendDAE.Var var;
DAE.ComponentRef cr;
DAE.Type ty;
String errorMessage;
BackendDAE.EquationArray eqns, reeqns;
DAE.Exp bindExp, crefExp;
DAE.ElementSource source;
Expand All @@ -1835,12 +1832,11 @@ algorithm
then ((var, (eqns, reeqns)));

case ((var, _)) equation
errorMessage = "./Compiler/BackEnd/Initialization.mo: function collectInitialBindings failed for: " +& BackendDump.varString(var);
Error.addMessage(Error.INTERNAL_ERROR, {errorMessage});
Error.addInternalError("./Compiler/BackEnd/Initialization.mo: function collectInitialBindings failed for: " +& BackendDump.varString(var));
then fail();

else equation
Error.addMessage(Error.INTERNAL_ERROR, {"./Compiler/BackEnd/Initialization.mo: function collectInitialBindings failed"});
Error.addInternalError("./Compiler/BackEnd/Initialization.mo: function collectInitialBindings failed");
then fail();
end match;
end collectInitialBindings;
Expand Down

0 comments on commit e234a04

Please sign in to comment.