From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!uw-beaver!uw-june!pattis From: pattis@cs.washington.edu (Richard Pattis) Newsgroups: comp.lang.ada Subject: Re: Optional Sequence of Statements Before Exception Handlers Summary: Here is how I do it Keywords: exception handling Message-ID: <12427@june.cs.washington.edu> Date: 30 Jun 90 17:21:26 GMT References: <34741@vrdxhq.verdix.com> Organization: U of Washington, Computer Science, Seattle List-Id: In article <34741@vrdxhq.verdix.com>, edm@vrdxhq.verdix.com (Ed Matthews) writes: > I've been thinking about the following situation recently: > > exception > when foo_error => > A; > B; > when bar_error => > A; > B; > C; > when others => > A; > B; > D; > end; > > and wondering if allowing the following would be a "good thing:" > > exception > A; > B; -- these two statements comprise the optional sequence before handlers > when foo_error => > null; > when bar_error => > C; > when others => > D; > end; > How about: EXCEPTION WHEN OTHERS => A; B; BEGIN RAISE; EXCEPTION WHEN foo_error => NULL; WHEN bar_error => C; WHEN others => D; END; -- Can put post statements here (done for all exceptions) END; Rich Pattis PS: Actually, I've never programmed this, but I have thought about it; if it won't work, I'm sure some kind soul will tell me so, loudly.