From 560b415f19823773e1368703e34f783745d1cff2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 14 Nov 2018 17:19:30 +0100 Subject: [PATCH] Replace Base::Exception with appropriate subclass --- src/Mod/Fem/App/FemMesh.cpp | 6 +++--- src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp | 2 +- src/Mod/Fem/App/FemPostPipeline.cpp | 4 ++-- src/Mod/Fem/Gui/TaskFemConstraint.cpp | 2 +- src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 17cdaa4fae..9c8b7c367a 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -1175,7 +1175,7 @@ void FemMesh::read(const char *FileName) // checking on the file if (!File.isReadable()) - throw Base::Exception("File to load not existing or not readable"); + throw Base::FileException("File to load not existing or not readable", File); if (File.hasExtension("unv") ) { // read UNV file @@ -1206,7 +1206,7 @@ void FemMesh::read(const char *FileName) } #endif else{ - throw Base::Exception("Unknown extension"); + throw Base::FileException("Unknown extension"); } } @@ -1640,7 +1640,7 @@ void FemMesh::write(const char *FileName) const } #endif else{ - throw Base::Exception("An unknown file extension was added!"); + throw Base::FileException("An unknown file extension was added!"); } } diff --git a/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp b/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp index 5116e32039..107e19f6fe 100644 --- a/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp +++ b/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp @@ -99,7 +99,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void) myNetGenMesher.Compute(); - // throw Base::Exception("Compute Done\n"); + // throw Base::RuntimeError("Compute Done\n"); SMESHDS_Mesh* data = const_cast(newMesh.getSMesh())->GetMeshDS(); const SMDS_MeshInfo& info = data->GetMeshInfo(); diff --git a/src/Mod/Fem/App/FemPostPipeline.cpp b/src/Mod/Fem/App/FemPostPipeline.cpp index 22462f5705..ca03c479d1 100644 --- a/src/Mod/Fem/App/FemPostPipeline.cpp +++ b/src/Mod/Fem/App/FemPostPipeline.cpp @@ -132,7 +132,7 @@ void FemPostPipeline::read(Base::FileInfo File) { // checking on the file if (!File.isReadable()) - throw Base::Exception("File to load not existing or not readable"); + throw Base::FileException("File to load not existing or not readable", File); if (File.hasExtension("vtu")) readXMLFile(File.filePath()); @@ -147,7 +147,7 @@ void FemPostPipeline::read(Base::FileInfo File) { else if (File.hasExtension("vtk")) readXMLFile(File.filePath()); else - throw Base::Exception("Unknown extension"); + throw Base::FileException("Unknown extension"); } diff --git a/src/Mod/Fem/Gui/TaskFemConstraint.cpp b/src/Mod/Fem/Gui/TaskFemConstraint.cpp index fdd1b32286..d0edf8e044 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraint.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraint.cpp @@ -208,7 +208,7 @@ bool TaskDlgFemConstraint::accept() Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()"); if (!ConstraintView->getObject()->isValid()) - throw Base::Exception(ConstraintView->getObject()->getStatusString()); + throw Base::RuntimeError(ConstraintView->getObject()->getStatusString()); Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()"); Gui::Command::commitCommand(); } diff --git a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp index c1d89bc27c..93a1e05439 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp @@ -141,7 +141,7 @@ bool TaskDlgFemConstraintInitialTemperature::accept() try { Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()"); if (!ConstraintView->getObject()->isValid()) - throw Base::Exception(ConstraintView->getObject()->getStatusString()); + throw Base::RuntimeError(ConstraintView->getObject()->getStatusString()); Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()"); Gui::Command::commitCommand(); }