---C++: inline
---C++: return &
---Level: Advanced
-
- Abort(myclass) is private;
- ---Purpose: A exception is raised but it is not yet caught.
- -- So Abort the current function and transmit the exception
- -- to "calling routines".
- -- Warning: If no catch is prepared for this exception, it displays the
- -- exception name and calls "exit(1)".
- ---Level: Internal
-
+
+ Abort(myclass; theError : Failure) is private;
+ ---Purpose: A exception is raised but it is not yet caught.
+ -- So Abort the current function and transmit the exception
+ -- to "calling routines".
+ -- Warning: If no catch is prepared for this exception, it displays the
+ -- exception name and calls "exit(1)".
+ ---Level: Internal
+
Error(me) returns Failure;
---Purpose: Returns the current Error.
void Standard_ErrorHandler::Destroy()
{
Unlink();
- if(myStatus==Standard_HandlerJumped) {
- //jumped, but not caut
- Abort();
+ if (myStatus == Standard_HandlerJumped)
+ {
+ // jumped, but not caught
+ Abort (myCaughtError);
}
}
//==== Abort if there is a non null 'Error'
//============================================================================
-void Standard_ErrorHandler::Abort ()
+void Standard_ErrorHandler::Abort (const Handle(Standard_Failure)& theError)
{
Standard_ErrorHandler* anActive = FindHandler(Standard_HandlerVoid, Standard_True);
-
+
//==== Check if can do the "longjmp" =======================================
if(anActive == NULL || anActive->myLabel == NULL) {
cerr << "*** Abort *** an exception was raised, but no catch was found." << endl;
- Handle(Standard_Failure) anErr =
- ( anActive != NULL && ! anActive->myCaughtError.IsNull() ?
- anActive->myCaughtError : Standard_Failure::Caught() );
- if ( ! anErr.IsNull() )
- cerr << "\t... The exception is:" << anErr->GetMessageString() << endl;
+ if (!theError.IsNull())
+ cerr << "\t... The exception is:" << theError->GetMessageString() << endl;
exit(1);
}
-
+
anActive->myStatus = Standard_HandlerJumped;
longjmp(anActive->myLabel, Standard_True);
}
}
-void Standard_ErrorHandler::Error(const Handle(Standard_Failure)& aError)
+void Standard_ErrorHandler::Error (const Handle(Standard_Failure)& theError)
{
- Standard_ErrorHandler* anActive = FindHandler(Standard_HandlerVoid, Standard_False);
- if(anActive==0)
- Abort();
-
- anActive->myCaughtError = aError;
-}
+ Standard_ErrorHandler* anActive = FindHandler (Standard_HandlerVoid, Standard_False);
+ if (anActive == NULL)
+ Abort (theError);
+ anActive->myCaughtError = theError;
+}
Standard_ErrorHandler* Standard_ErrorHandler::FindHandler(const Standard_HandlerStatus theStatus,
void Standard_Failure::Reraise ()
{
#ifdef NO_CXX_EXCEPTION
- Standard_ErrorHandler::Error(this) ;
- Standard_ErrorHandler::Abort();
+ Standard_ErrorHandler::Error (this);
+ Standard_ErrorHandler::Abort (this);
#else
RaisedError = this;
Throw();
void Standard_Failure::Jump() const
{
#if defined (NO_CXX_EXCEPTION) || defined (OCC_CONVERT_SIGNALS)
- Standard_ErrorHandler::Error(this) ;
- Standard_ErrorHandler::Abort();
+ Standard_ErrorHandler::Error (this);
+ Standard_ErrorHandler::Abort (this);
#else
RaisedError = this;
Throw();