Project

General

Profile

Bug #9061

Catch inside a catch block does not work.

Added by Artur Școlnic almost 2 years ago. Updated almost 2 years ago.

Status:
WIP
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Artur Școlnic almost 2 years ago

if (yes) then undo, throw new Progress.Lang.AppError("Error1", 1). 
catch e as Progress.Lang.Error :
   define variable e1 as Progress.Lang.AppError no-undo.
   e1 = new Progress.Lang.AppError("Error2", 2).
   message "Caught!".
   undo, throw e1.
end catch.

In 4GL Caught! is displayed and Error2 is thrown.
In FWD Caught! is displayed and Error1 is thrown.

#3 Updated by Artur Școlnic almost 2 years ago

This task was derived from #8912-194.

#4 Updated by Artur Școlnic almost 2 years ago

  • Status changed from New to WIP

#5 Updated by Artur Școlnic almost 2 years ago

if (yes) then undo, throw new Progress.Lang.AppError("Error1", 1). 
catch e as Progress.Lang.Error :
   define variable e1 as Progress.Lang.AppError no-undo.
   e1 = new Progress.Lang.AppError("Error2", 2).
   message "Caught!".
   undo, throw e1.
   catch e2 as Progress.Lang.Error :
      message "Caught2!".
   end catch.
end catch.

In this situation, in FWD, none of the errors are being caught, Error1 is thrown and execution stops.

#6 Updated by Artur Școlnic almost 2 years ago

If undoThrowTopLevel is called inside a catch block, undoThrow is used instead for that error. undoThrow simply lacks any instructions for displaying the error, adding them results in displaying Error2, the problem is that Error1 is also displayed.

#7 Updated by Artur Școlnic almost 2 years ago

To match the behavior of 4GL for the test case in #9061-1, I disabled displayError in undoThrowTopLevel and added it in undoThrow, but I am not sure if this should be done at all, displaying the error shouldn't have a huge impact on the overall logic of the programs.

#8 Updated by Artur Școlnic almost 2 years ago

  • Subject changed from Reassigned error is not thrown to Catch inside a catch block does not work.

Also available in: Atom PDF