* ERRHANDL.H - include file for generic MDA error-handling facilities * By M. Asherman, Copyright (c) 1999, SpaceTime Systems * 11/20/99: added macros used in wrapper function, ErrHandl.prg. * 11/22/99: add macros to avoid hard-wired refs to "errhandler" in errhform class. * 11/25/99: add macros for error codes and messages used in errhtarg.prg. * 11/26/99: more macros for error codes and messages used in errhtarg.prg. * Also adding error codes and messages used in errhandl.scx. * 11/27/99: remove obsolete macros made unnecessary by more flexible ehp_... properties. * 11/10/00: add more macros for error codes and messages used by errhtarg (see erma0008). * 11/12-3/00: add more macros for error codes and messages (see erma0009, erma0004). * 11/17/00: add more error codes/msgs for ERRHSHOW (phasing out ERRHTRAC). * 11/18-12/4/00: macros for diagnostics, tracing, logging & abnormal errors (see erma0005). * * Let foundation class error codes all be negative, as opposed to application error codes. * Macro for maximum allowable WAIT WINDOW message length, which is really * an undocumented, VFP-imposed limit. Used by errhshow.prg. #define ERRH_MAXWAITWINDLEN 254 && a VFP error occurs if this is exceeded * Macros for VFP error code when too many args are passed. (See property ehp_ignore_noparam.) #define ERRH_VFPERR_NEEDPARAM 94 && Must specify additional parameters. #define ERRH_VFPERR_NOPARAM 1238 && No PARAMETER statement is found. * Macros for MESSAGEBOX() icon types used by errhshow.prg #define ERRH_MESSBOX_ICON_ERR 16 && error message case - stop sign #define ERRH_MESSBOX_ICON_INF 64 && tracing/warning/info message cases - info icon * Macros for message output modes supported by errhshow() and EHM_ShowAppErr() #define ERRH_SHOWMODE_DEFAULT 0 && lets properties determine mode of output #define ERRH_SHOWMODE_DIAGFORCE 1 && forces use of the diagnostic dialog #define ERRH_SHOWMODE_NOWAIT 2 && forces use of WAIT WINDOW NOWAIT * Macros related to diagnostic features, used by errhshow.prg #define ERRH_DIAGD_CLASS 'ErrHDiagDialog' && class name of diagnostic dialog #define ERRH_DIAGD_LIB 'errhandl' && class library name for diag dialog * Macros for diagnostic dialog return codes, stored in property ehp_diagresponse * upon return from errhshow() or EHM_ShowAppErr(). #define ERRH_DIAGRESP_OK '' && OK button or no interaction - the default #define ERRH_DIAGRESP_IGNORE 'IGNORE' && IGNORE button - disregard error/continue #define ERRH_DIAGRESP_RETRY 'RETRY' && RETRY button - re-execute failed code #define ERRH_DIAGRESP_ABORT 'ABORT' && ABORT button - self-destructs * Macros for trace levels used in property ehp_tracelevel. #define ERRH_TRACE_ERRHERR 2 && traces anticipated error cases in errherr.prg && (i.e. cases otherwise suppressed until they && are reported by the method that anticipated them.) #define ERRH_TRACE_ACTIVATION 3 && traces ErrHForm Init/Unload events #define ERRH_TRACE_ACTIVATION2 9 && adds NOWAIT tracing in ErrHForm Activate/Deactivate * Macro for default catch-all ON ERROR command line, if ehp_on_err_handle is enabled. * Used in errhform.Init, Activate and errhdiagdialog.Unload. #define ERRH_ON_ERROR "errhoerr(ERROR(), PROGRAM(), LINENO(), MESSAGE(), SYS(2018))" * Macros related to optional echoing to an ASCII log file #define ERRH_LOG_EXTS 'txt|log' && extensions passed to PUTFILE() for prompting #define ERRH_LOG_NAMEDFLT 'log' && default log name if ehp_appname is blank * Macros for preferred absolute/relative path representation options. * These are stored in ehp_pathtypedefault, which is used for canonicalizing the * log file path obtained via PUTFILE() in the diagnostic message dialog. #define ERRH_PATHTYPE_ABS 0 && absolute (full) path, including drive and directory #define ERRH_PATHTYPE_NODRIVE 1 && absolute path, omitting the drive specification #define ERRH_PATHTYPE_MINPATH 2 && minimum path relative to the current directory * Macros for error codes and messages used in errhtarg.prg #define ERRH_EC_TARG_NOOBJ -1 && error code #define ERRH_EM_TARG_NOOBJ "First argument must be a valid ErrHandler object reference." #define ERRH_EC_TARG_INVTARG -2 && error code #define ERRH_EM_TARG_INVTARG "Invalid target ErrHandler object reference." #define ERRH_EC_TARG_INVTARGTYP -3 && error code #define ERRH_EM_TARG_INVTARGTYP "Invalid non-empty target ErrHandler argument." #define ERRH_EC_TARG_ISSELF -4 && error code #define ERRH_EM_TARG_ISSELF "Target ErrHandler is the same as self - circularity is prohibited." #define ERRH_EC_TARG_NOPUB -5 && error code #define ERRH_EM_TARG_NOPUB "Unable to declare PUBLIC mvar: " #define ERRH_EC_TARG_NONEW -6 && error code #define ERRH_EM_TARG_NONEW "Unable to create target error handler object: " #define ERRH_EC_TARG_INUSE -7 && error code #define ERRH_EM_TARG_INUSE "Target name is already in use, but is not an ErrHandler: " #define ERRH_EC_TARG_NOPA -8 && error code #define ERRH_EM_TARG_NOPA "Parent object for target error handler doesn't exist: " #define ERRH_EC_TARG_INVMEMB -9 && error code #define ERRH_EM_TARG_INVMEMB "Target member or property exists but is not a valid ErrHandler: " #define ERRH_EC_TARG_NONEWM -10 && error code #define ERRH_EM_TARG_NONEWM "Unable to create new target error handler member object: " #define ERRH_EC_ERR_INVARG1 -20 && error code #define ERRH_EM_ERR_INVARG1 "First argument must be an ErrHandler object reference." #define ERRH_EC_ERR_INVRESPONSE -21 && error code #define ERRH_EM_ERR_INVRESPONSE "Unexpected response from Diagnostic message dialog: " #define ERRH_EC_ERR_UNEXPECTED -22 && error code #define ERRH_EM_ERR_UNEXPECTED "An exceptional error occurred:" #define ERRH_EC_SHOW_INVARG1 -30 && error code #define ERRH_EM_SHOW_INVARG1 "First argument must be a valid ErrHandler object reference." #define ERRH_EC_SHOW_INVERNO -31 && error code #define ERRH_EM_SHOW_INVERNO "Invalid error number argument." #define ERRH_EC_SHOW_INVMSG -32 && error code #define ERRH_EM_SHOW_INVMSG "Invalid message string argument." #define ERRH_EC_SHOW_INVTITLE -33 && error code #define ERRH_EM_SHOW_INVTITLE "Invalid title string argument." #define ERRH_EC_SHOW_INVMODE -34 && error code #define ERRH_EM_SHOW_INVMODE "Invalid output mode argument (see allowed numeric codes in errhandl.h)." #define ERRH_EC_SHOW_INVIGNO -35 && error code #define ERRH_EM_SHOW_INVIGNO "Invalid allow-Ignore flag (logical) argument." #define ERRH_EC_SHOW_INVRETRY -36 && error code #define ERRH_EM_SHOW_INVRETRY "Invalid allow-Retry flag (logical) argument." #define ERRH_EC_SHOW_INVABORT -37 && error code #define ERRH_EM_SHOW_INVABORT "Invalid Abort-to-depth (numeric) argument." #define ERRH_EC_SHOW_LOGWRITE -38 && error code #define ERRH_EM_SHOW_LOGWRITE "Unable to output to log file: " #define ERRH_EC_SHOW_ABORT -39 && error code #define ERRH_EM_SHOW_ABORT "User Aborted via the diagnostic message dialog." #define ERRH_EC_SHOW_LOGAPI -40 && error code #define ERRH_EM_SHOW_LOGAPI "Can't do external API-based message logging via: " #define ERRH_EC_ONERR_NOFORM -50 && error code #define ERRH_EM_ONERR_NOFORM "The current ON ERROR handler requires an active ErrHForm." #define ERRH_EC_ONERR_ABNORMAL -51 && error code #define ERRH_EM_ONERR_ABNORMAL "An abnormal error occurred:" #define ERRH_EC_ONERR_INVRESPONSE -52 && error code #define ERRH_EM_ONERR_INVRESPONSE "Unexpected response from Diagnostic message dialog: " #define ERRH_EC_DIAGDLG_PATHTYPE -60 && error code #define ERRH_EM_DIAGDLG_PATHTYPE "Invalid setting of the ehp_pathtypedefault property." ************************* Demo-Related Macros ************************* * Macro used only in the demo wrapper function, ErrHandl.prg #define ERRH_PUBNM errhandlxx && reserved public mvar name used for the RunN mode * Macros for demo form errhandl.scx Action codes #define ERRH_ACPRM 'prompt' && prompt the user with modal dialog form #define ERRH_ACPRN 'promptn' && prompt the user with modeless dialog form #define ERRH_ACRNM 'run' && Run a command non-interactively (modal - synchronous) #define ERRH_ACRNN 'runn' && Run a command non-interactively (non-modal - asynchronous) * Macros for trace levels used in property ehp_tracelevel by demo form errhandl.scx. #define ERRH_TRACEDEMO_ALL 5 && traces all significant methods of errhandl.scx * Error codes and messages used in demo form errhandl.scx, Init method * Since this is a sample application, not a foundation class, we use codes > 0. #define ERRH_EC_EHCINI_ACTION 1 && error code #define ERRH_EM_EHCINI_ACTION "Unsupported Action argument. Must be " + chr(13) + proper(ERRH_ACPRM) + ", " + proper(ERRH_ACPRN) + ", " + proper(ERRH_ACRNM) + ", or " + proper(ERRH_ACRNN) #define ERRH_EC_EHCINI_CMDARG 2 && error code #define ERRH_EM_EHCINI_CMDARG "Invalid command line argument - not a character value." #define ERRH_EC_EHCINI_RUNERR 3 && error code #define ERRH_EM_EHCINI_RUNERR "Command failed: "