Base: simplify Exception

Remove repetition. Add functions to replace macros, but keep macros
in use for now as some compilers have broken std::source_location
support.
This commit is contained in:
bofdahof
2025-03-18 17:47:10 +10:00
committed by Ladislav Michl
parent a1c5950d9a
commit 838178bb1c
4 changed files with 354 additions and 1088 deletions

View File

@@ -162,13 +162,13 @@ DlgProjectionOnSurface::DlgProjectionOnSurface(QWidget* parent)
m_partDocument = App::GetApplication().getActiveDocument();
if (!m_partDocument) {
throw Base::ValueError(QString(tr("Have no active document!!!")).toUtf8());
throw Base::ValueError(tr("Have no active document!!!").toStdString());
}
this->attachDocument(m_partDocument);
m_partDocument->openTransaction("Project on surface");
m_projectionObject = m_partDocument->addObject<Part::Feature>("Projection Object");
if (!m_projectionObject) {
throw Base::ValueError(QString(tr("Can not create a projection object!!!")).toUtf8());
throw Base::ValueError(tr("Can not create a projection object!!!").toStdString());
}
m_projectionObject->Label.setValue(std::string(m_projectionObjectName.toUtf8()).c_str());
onRadioButtonShowAllClicked();