Re: ? - packages - how2 declare common exceptions?

From: David Hermann <dhe_at_phcs.phcs.com>
Date: 1995/06/15
Message-ID: <3rqb67$f4c_at_palm.phcs.com>#1/1


In article <1995Jun14.183238.19135_at_tron.bwi.wec.com>, Mize.T.E%WEC_at_DIALCOM.TYMNET.COM (Tom Mize) writes:
|> In a package, how can I declare an exception (when .. then and some
|> code, etc.) that I can raise from
|> within any Proc in that package. I need an example! I have tried to put a
|> Begin block at the end of the PAckage body and then raise it from
|> inside procs, but I get 'unhandled exception' errors. The books do not
|> have an example. Please e-mail me. Thanks!
|>
|> package body ......
|> norec exception;
|> proc1 as ......
|> raise norec; /* norec is the common exception code block */
|> end;
|> proc2 .....
|> raise norec;
|> end proc2;
|>
|>
|> end body --------- where does the exception code go?
 

You've successfully defined an exception that can be raised by multiple procedures. It sounds like you want a shared exception *handler*, which I don't think is possible. At the least, you need to say

     when norec then ...

at the end of each procedure. Maybe all these statements could call a new procedure, say "handle_norec". Received on Thu Jun 15 1995 - 00:00:00 CEST

Original text of this message