Thu, 06/23/2022 - 01:03
Forums:
How to handle a try and catch to handle Standard_Failure?
try
{
//some OCC code...
}
catch (Standard_Failure)
{
Handle_Standard_Failure e = Standard_Failure::Caught();
PyErr_SetString(PartExceptionOCCError, e->GetMessageString());
}
It seems that Standard_Failure::Caught();
does not longer exist?
should we use: catch (Standard_Failure& err)
or use : catch(Handle(Standard_Failure) err)
Thu, 06/23/2022 - 09:50
or in paranoid verbose mode:
Thu, 06/23/2022 - 12:01
Thanks!
Wed, 08/16/2023 - 12:42
i have a function as follows:
bool func( ... ){
try {
OCC_CATCH_SIGNALS
//do something
}
catch ( const Standard_Failure& theFailure){
}
catch ( const std::exception& theExcetp){
}
catch( ... ){
}
...
}
it doesnt work with OCC_CATCH_SIGNALS when i call this function the process crashed directly ,i am really confused.
i tried with OCC_CATCH_SIGNALS,it works sometimes ,but not always.
Is there any rule when we use try/catch to handle OCC related exception?
i use { } to include the code when try/catch exception.