gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exception handling within a compound statement?


From: Philip Munts
Subject: Exception handling within a compound statement?
Date: Tue, 19 Dec 2023 19:20:21 -0800
User-agent: Mozilla Thunderbird

Ada allows exception handling within each begin/end block, and
also allows a begin/end block inside a compound statement:

loop
  begin
    raise Program_Error;
  exception
    when Program_Error =>
      ...
  end;
end loop;

Does GM2 allow something similar, or can exceptions be caught
only at the procedure or module level?

I like to use exceptions to propagate errors in Ada embedded
real-time software, since they can be caught and handled
anywhere along the calling chain or just ignored to abort the
program.

If exceptions can only be caught at procedure or module level
on the way out to a program abort, they are much less useful
to me.

Phil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]