From: Paul RASCLE Date: Sat, 14 Nov 2020 16:25:41 +0000 (+0100) Subject: abort on Standard_Failure::Caught: failure is sometimes null. Deprecated, use standar... X-Git-Tag: SH_V2_2_0~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=541721881c089d382d8734b3bf2e6323415c5233;p=modules%2Fhydro.git abort on Standard_Failure::Caught: failure is sometimes null. Deprecated, use standard C++ mecanism instead --- diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index 3a69f8c3..ebf31719 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -825,10 +825,9 @@ void HYDROGUI_CalculationOp::onApply() { aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries ); } - catch ( Standard_Failure ) + catch ( Standard_Failure& e ) { - Handle(Standard_Failure) aFailure = Standard_Failure::Caught(); - anErrorMsg = aFailure->GetMessageString(); + anErrorMsg = e.GetMessageString(); aResult = false; } catch ( ... ) diff --git a/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx b/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx index b024f3b5..94a7cb48 100644 --- a/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx @@ -111,10 +111,9 @@ void HYDROGUI_ExportCalculationOp::onApply() try { aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries ); } - catch ( Standard_Failure ) + catch ( Standard_Failure& e ) { - Handle(Standard_Failure) aFailure = Standard_Failure::Caught(); - anErrorMsg = aFailure->GetMessageString(); + anErrorMsg = e.GetMessageString(); aResult = false; } catch ( ... ) diff --git a/src/HYDROGUI/HYDROGUI_Operation.cxx b/src/HYDROGUI/HYDROGUI_Operation.cxx index f95f891f..2cecdcde 100644 --- a/src/HYDROGUI/HYDROGUI_Operation.cxx +++ b/src/HYDROGUI/HYDROGUI_Operation.cxx @@ -250,11 +250,10 @@ void HYDROGUI_Operation::apply() { aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries ); } - catch ( Standard_Failure ) + catch ( Standard_Failure& e ) { - Handle(Standard_Failure) aFailure = Standard_Failure::Caught(); - if (aFailure) - anErrorMsg = aFailure->GetMessageString(); + if (&e) + anErrorMsg = e.GetMessageString(); else anErrorMsg = "failure unknown: catch ( Standard_Failure ) does not give access to failure!"; aResult = false; diff --git a/src/HYDROGUI/HYDROGUI_StreamOp.cxx b/src/HYDROGUI/HYDROGUI_StreamOp.cxx index 14db0d12..89a5186d 100755 --- a/src/HYDROGUI/HYDROGUI_StreamOp.cxx +++ b/src/HYDROGUI/HYDROGUI_StreamOp.cxx @@ -243,10 +243,9 @@ void HYDROGUI_StreamOp::apply() { aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries ); } - catch ( Standard_Failure ) + catch ( Standard_Failure& e ) { - Handle(Standard_Failure) aFailure = Standard_Failure::Caught(); - anErrorMsg = aFailure->GetMessageString(); + anErrorMsg = e.GetMessageString(); aResult = false; } catch ( ... )