Replace Base::Exception with appropriate subclass

This commit is contained in:
wmayer
2018-11-14 17:11:53 +01:00
parent 4f02b209fc
commit f34ec4534c
8 changed files with 20 additions and 20 deletions

View File

@@ -89,7 +89,7 @@ bool getConstraintPrerequisits(Assembly::Product** Asm, Assembly::ConstraintGrou
*ConstGrp = getConstraintGroup(*Asm);
if(!*ConstGrp)
throw Base::Exception("Could not create Assembly::ConstraintGroup in active Assembly");
throw Base::RuntimeError("Could not create Assembly::ConstraintGroup in active Assembly");
// return with no error
return false;

View File

@@ -230,7 +230,7 @@ static PyObject * tesselateShape(PyObject *self, PyObject *args)
// if the triangulation of only one face is not possible to get
else
{
throw Base::Exception("Empty face triangulation\n");
throw Base::RuntimeError("Empty face triangulation\n");
}
}
// finish FreeCAD Mesh Builder and exit with new mesh

View File

@@ -694,7 +694,7 @@ void Approximate::ParameterInnerPoints()
}
else //Can an inside point have less than 3 neighbours...?
{
throw Base::Exception("Something's wrong here. Less than 3 Neighbour");
throw Base::RuntimeError("Something's wrong here. Less than 3 Neighbour");
}
}
}

View File

@@ -308,7 +308,7 @@ bool SpringbackCorrection::CalcCurv()
if (pnt2edge.IsDone() == false)
{
throw Base::Exception("couldn't perform distance calculation pnt2edge \n");
throw Base::RuntimeError("couldn't perform distance calculation pnt2edge \n");
}
dist = pnt2edge.Value();
@@ -730,7 +730,7 @@ bool SpringbackCorrection::TransferFaceTriangulationtoFreeCAD(const TopoDS_Face&
// if the triangulation of only one face is not possible to get
else
{
throw Base::Exception("Empty face triangulation\n");
throw Base::RuntimeError("Empty face triangulation\n");
}
// finish FreeCAD Mesh Builder and exit with new mesh

View File

@@ -82,7 +82,7 @@ bool UniGridApprox::Perform(double TOL)
maxErr = CompMeshError();
if (maxErr == -1)
throw Base::Exception("CompError() couldn't project one point...");
throw Base::RuntimeError("CompError() couldn't project one point...");
cout << " -> " << maxErr << endl;

View File

@@ -875,7 +875,7 @@ bool best_fit::RotMat(Base::Matrix4D &M, double degree, int axis)
M[1][1]=cos(degree);
break;
default:
throw Base::Exception("second input value differs from 1,2,3 (x,y,z)");
throw Base::RuntimeError("second input value differs from 1,2,3 (x,y,z)");
}
return true;
@@ -897,7 +897,7 @@ bool best_fit::TransMat(Base::Matrix4D &M, double trans, int axis)
M[2][3] = trans;
break;
default:
throw Base::Exception("second input value differs from 1,2,3 (x,y,z)");
throw Base::RuntimeError("second input value differs from 1,2,3 (x,y,z)");
}
return true;
@@ -1390,7 +1390,7 @@ bool best_fit::Tesselate_Face(const TopoDS_Face &aface, MeshCore::MeshKernel &me
// if the triangulation of only one face is not possible to get
else
{
throw Base::Exception("Empty face triangulation\n");
throw Base::RuntimeError("Empty face triangulation\n");
}
// finish FreeCAD Mesh Builder and exit with new mesh
@@ -1484,7 +1484,7 @@ bool best_fit::Tesselate_Shape(const TopoDS_Shape &shape, MeshCore::MeshKernel &
// if the triangulation of only one face is not possible to get
else
{
throw Base::Exception("Empty face triangulation\n");
throw Base::RuntimeError("Empty face triangulation\n");
}
}
// finish FreeCAD Mesh Builder and exit with new mesh

View File

@@ -192,7 +192,7 @@ double path_simulate::GetVelocity(double t)
}
}
else
throw Base::Exception("time input not inside [t0, T]");
throw Base::RuntimeError("time input not inside [t0, T]");
return vel;
}
@@ -242,7 +242,7 @@ double path_simulate::GetDistance(double t)
}
else
{
throw Base::Exception("time input not inside [t0,T]");
throw Base::RuntimeError("time input not inside [t0,T]");
}
return d;
@@ -3060,7 +3060,7 @@ bool path_simulate::WriteOutputSingle(ofstream &anOutputFile, int &c, bool brob,
n = Out_val.size();
if (n != Out_time.size())
throw Base::Exception("Outputlängen passen nicht zusammen");
throw Base::RuntimeError("Outputlängen passen nicht zusammen");
if (n>1)
{

View File

@@ -68,7 +68,7 @@ void GTSAlgos::coarsen(float f)
} catch (...)
{
gts_object_destroy (GTS_OBJECT (surface));
throw Base::Exception("Unknown error in GTSAlgos::coarsen()");
throw Base::RuntimeError("Unknown error in GTSAlgos::coarsen()");
}
// get the standard mesh
@@ -99,12 +99,12 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type)
if (!gts_surface_is_orientable (s1)) {
gts_object_destroy (GTS_OBJECT (s1));
gts_object_destroy (GTS_OBJECT (s2));
throw Base::Exception("surface 1 is not an orientable manifold\n");
throw Base::RuntimeError("surface 1 is not an orientable manifold\n");
}
if (!gts_surface_is_orientable (s2)) {
gts_object_destroy (GTS_OBJECT (s1));
gts_object_destroy (GTS_OBJECT (s2));
throw Base::Exception("surface 2 is not an orientable manifold\n");
throw Base::RuntimeError("surface 2 is not an orientable manifold\n");
}
// check that the surfaces are not self-intersecting
@@ -119,7 +119,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type)
gts_object_destroy (GTS_OBJECT (self_intersects));
gts_object_destroy (GTS_OBJECT (s1));
gts_object_destroy (GTS_OBJECT (s2));
throw Base::Exception("surface is self-intersecting\n");
throw Base::RuntimeError("surface is self-intersecting\n");
}
self_intersects = gts_surface_is_self_intersecting (s2);
if (self_intersects != NULL) {
@@ -129,7 +129,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type)
gts_object_destroy (GTS_OBJECT (self_intersects));
gts_object_destroy (GTS_OBJECT (s1));
gts_object_destroy (GTS_OBJECT (s2));
throw Base::Exception("surface is self-intersecting\n");
throw Base::RuntimeError("surface is self-intersecting\n");
}
}
@@ -149,7 +149,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type)
gts_object_destroy (GTS_OBJECT (s2));
gts_bb_tree_destroy (tree1, TRUE);
gts_bb_tree_destroy (tree2, TRUE);
throw Base::Exception("the intersection of 1 and 2 is not a closed curve\n");
throw Base::RuntimeError("the intersection of 1 and 2 is not a closed curve\n");
}
s3 = gts_surface_new (gts_surface_class (),
@@ -193,7 +193,7 @@ void GTSAlgos::boolean(const Mesh::MeshObject& ToolMesh, int Type)
gts_object_destroy (GTS_OBJECT (si));
gts_bb_tree_destroy (tree1, TRUE);
gts_bb_tree_destroy (tree2, TRUE);
throw Base::Exception("the resulting surface is self-intersecting\n");
throw Base::RuntimeError("the resulting surface is self-intersecting\n");
}
}
// display summary information about the resulting surface