Replace Base::Exception with appropriate subclass

This commit is contained in:
wmayer
2018-11-14 17:19:30 +01:00
parent e22ab44e61
commit 145cefb131
5 changed files with 8 additions and 8 deletions

View File

@@ -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!");
}
}

View File

@@ -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<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
const SMDS_MeshInfo& info = data->GetMeshInfo();

View File

@@ -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<vtkXMLUnstructuredGridReader>(File.filePath());
@@ -147,7 +147,7 @@ void FemPostPipeline::read(Base::FileInfo File) {
else if (File.hasExtension("vtk"))
readXMLFile<vtkDataSetReader>(File.filePath());
else
throw Base::Exception("Unknown extension");
throw Base::FileException("Unknown extension");
}

View File

@@ -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();
}

View File

@@ -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();
}