From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f8a1,e7e13c943c611b62 X-Google-Attributes: gid10f8a1,public X-Google-Thread: 1164f8,be3d6a6131c61fa7 X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,be3d6a6131c61fa7 X-Google-Attributes: gid102b75,public From: hoffman@xdelta.enet.dec.nospam (Hoff Hoffman) Subject: Re: Exceptions, Error codes, and Wrappers Date: 1999/04/19 Message-ID: <7fftn7$q5n@usenet.pa.dec.com>#1/1 X-Deja-AN: 468775059 Distribution: world References: <36E9F2A0.9A401A09@pacific.net.sg> <7cj96m$h07$1@plonk.apk.net> <7eih45$ln2$1@news.doit.wisc.edu> <7fdlck$114a$1@news.doit.wisc.edu> Followup-To: vmsnet.alpha Organization: Compaq Computer Corporation Reply-To: hoffman@xdelta.zko.dec.nospam Newsgroups: comp.arch,comp.sys.dec,vmsnet.alpha OpenVMS questions are often best discussed in comp.os.vms. And if you cross-post questions, please consider setting a follow-up group. (Followups set to vmsnet.alpha.) In article <7fdlck$114a$1@news.doit.wisc.edu>, "Andy Glew" writes: : :>>: #if DEBUG :>>: #define FLAG_ERROR(error) if(error!=noErr) Debugger() :>>: #else :>>: #define FLAG_ERROR(error) :>>: #endif : :> :>As I pointed out elsewhere, that's irrelevant when you are making calls :>into the OS and problems are returned via error numbers. Unless, I guess, :>you put a wrapper around every such call throwing an error, which is :>basically identical to my scheme. OpenVMS tends to use either distributed error handling (where each call uses explicit checks -- common on simpler applications), or it uses centralized or module-level or subroutine-level handling using OpenVMS signals and signal handlers (typical of larger and more complex applications). : :#define CATCH_ALL( errfunc ) try { errfunc } catch ( * ) { Debugger(); } or my typical use of: #include ... RetStat = ... if (!$VMS_STATUS_SUCCESS( RetStat )) lib$signal( SS$_DEBUG, AscicDebugCommand ); RetStat = ... if (!$VMS_STATUS_SUCCESS( RetStat )) return RetStat; -- More than most any sane person cares to know about this topic -- signals and condition handling -- is included in the OpenVMS Programming Concepts Manual... :-) -------------------------- pure personal opinion --------------------------- Hoff (Stephen) Hoffman OpenVMS Engineering hoffman#xdelta.zko.dec.com