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 Lines: 52 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.