Clear error message from parser.

--HG--
branch : feature
This commit is contained in:
dismine 2014-05-21 19:59:53 +03:00
parent 107b131fdf
commit 34bd172f9a
2 changed files with 25 additions and 57 deletions

View File

@ -346,13 +346,11 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
flag = false; flag = false;
palette.setColor(labelEditFormula->foregroundRole(), Qt::red); palette.setColor(labelEditFormula->foregroundRole(), Qt::red);
emit ToolTip(e.GetMsg()); emit ToolTip(e.GetMsg());
qDebug() << "\nError:\n" qDebug() << "\nMath parser error:\n"
<< "--------\n" << "--------------------------------------\n"
<< "Message: " << e.GetMsg() << "\n" << "Message: " << e.GetMsg() << "\n"
<< "Expression: \"" << e.GetExpr() << "\"\n" << "Expression: " << e.GetExpr() << "\n"
<< "Token: \"" << e.GetToken() << "\"\n" << "--------------------------------------";
<< "Position: " << e.GetPos() << "\n"
<< "Errc: " << QString::number(e.GetCode(), 16);
} }
} }
CheckState(); CheckState();

View File

@ -855,10 +855,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating point of end line"), domElement); VExceptionObjectError excep(tr("Error creating or updating point of end line"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -889,10 +886,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating point along line"), domElement); VExceptionObjectError excep(tr("Error creating or updating point along line"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -924,10 +918,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating point of shoulder"), domElement); VExceptionObjectError excep(tr("Error creating or updating point of shoulder"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -959,10 +950,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating point of normal"), domElement); VExceptionObjectError excep(tr("Error creating or updating point of normal"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -994,10 +982,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating point of bisector"), domElement); VExceptionObjectError excep(tr("Error creating or updating point of bisector"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -1049,10 +1034,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating point of contact"), domElement); VExceptionObjectError excep(tr("Error creating or updating point of contact"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -1165,10 +1147,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating cut spline point"), domElement); VExceptionObjectError excep(tr("Error creating or updating cut spline point"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -1196,10 +1175,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating cut spline path point"), domElement); VExceptionObjectError excep(tr("Error creating or updating cut spline path point"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -1226,10 +1202,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
{ {
VExceptionObjectError excep(tr("Error creating or updating cut arc point"), domElement); VExceptionObjectError excep(tr("Error creating or updating cut arc point"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }
@ -1420,10 +1393,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, const QDomElement &dom
{ {
VExceptionObjectError excep(tr("Error creating or updating simple arc"), domElement); VExceptionObjectError excep(tr("Error creating or updating simple arc"), domElement);
QString message("Message: " + e.GetMsg() + "\n"+ QString message("Message: " + e.GetMsg() + "\n"+
+ "Expression: \"" + e.GetExpr() + "\"\n"+ "Expression: " + e.GetExpr());
+ "Token: \"" + e.GetToken() + "\"\n"+
+ "Position: " + QString::number(e.GetPos()) + "\n"+
+ "Errc: " + QString::number(e.GetCode(), 16));
excep.AddMoreInformation(message); excep.AddMoreInformation(message);
throw excep; throw excep;
} }