Coding - Use throw instead of legacy Standard_Failure::Raise (#983)

Replace Standard_*::Raise calls with throw statements for better exception handling
This commit is contained in:
Kirill Gavrilov
2026-01-05 16:46:14 +00:00
committed by dpasukhi
parent 078dfc44ae
commit 6c6f2ceb41
16 changed files with 28 additions and 41 deletions

View File

@@ -863,7 +863,7 @@ void BRepFill::Axe(const TopoDS_Shape& Spine,
void BRepFill::SearchOrigin(TopoDS_Wire& W, const gp_Pnt& P, const gp_Vec& Dir, const double Tol)
{
if (!W.Closed())
Standard_NoSuchObject::Raise("BRepFill::SearchOrigin : the wire must be closed");
throw Standard_NoSuchObject("BRepFill::SearchOrigin : the wire must be closed");
bool NewVertex = false;
double theparam = 1.e101, angle;

View File

@@ -65,7 +65,7 @@ void BRepMesh_CurveTessellator::init()
{
if (myParameters.MinSize <= 0.0)
{
Standard_Failure::Raise("The structure \"myParameters\" is not initialized");
throw Standard_Failure("The structure \"myParameters\" is not initialized");
}
TopExp::Vertices(myEdge, myFirstVertex, myLastVertex);

View File

@@ -43,7 +43,7 @@ BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Shape& Spin
{
if (Spine.ShapeType() != TopAbs_WIRE && Spine.ShapeType() != TopAbs_FACE)
{
Standard_TypeMismatch::Raise("BRepOffsetAPI_MakeEvolved: face or wire is expected as a spine");
throw Standard_TypeMismatch("BRepOffsetAPI_MakeEvolved: face or wire is expected as a spine");
}
if (theIsVolume)
{
@@ -96,7 +96,7 @@ const BRepFill_Evolved& BRepOffsetAPI_MakeEvolved::Evolved() const
{
if (myIsVolume)
{
Standard_TypeMismatch::Raise(
throw Standard_TypeMismatch(
"BRepOffsetAPI_MakeEvolved: myEvolved is accessed while in volume mode");
}
return myEvolved;