Improve error handling for final measurements placeholders. #85

This commit is contained in:
Roman Telezhynskyi 2021-01-30 21:15:49 +02:00
parent 4ee901d97c
commit 6d3d624980
2 changed files with 8 additions and 4 deletions

View File

@ -263,8 +263,10 @@ QMap<QString, QString> PreparePlaceholders(const VAbstractPattern *doc, const VC
} }
catch (qmu::QmuParserError &e) catch (qmu::QmuParserError &e)
{ {
qCritical("%s\n\n%s", qUtf8Printable(QObject::tr("Failed to prepare final measurement placeholder.")), const QString errorMsg = QObject::tr("Failed to prepare final measurement placeholder. Parser error at "
qUtf8Printable(QObject::tr("Parser error at line %1: %2.").arg(i+1).arg(e.GetMsg()))); "line %1: %2.").arg(i+1).arg(e.GetMsg());
qApp->IsPedantic() ? throw VException(errorMsg) :
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
} }
} }

View File

@ -580,8 +580,10 @@ void DialogEditLabel::InitPlaceholders()
} }
catch (qmu::QmuParserError &e) catch (qmu::QmuParserError &e)
{ {
qCritical("%s\n\n%s", qUtf8Printable(QObject::tr("Failed to prepare final measurement placeholder.")), const QString errorMsg = QObject::tr("Failed to prepare final measurement placeholder. Parser error at "
qUtf8Printable(QObject::tr("Parser error at line %1: %2.").arg(i+1).arg(e.GetMsg()))); "line %1: %2.").arg(i+1).arg(e.GetMsg());
qApp->IsPedantic() ? throw VException(errorMsg) :
qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg;
} }
} }
} }