Error Reporting Functions

Defines

#define SetErrPosn(e)   _SetErrPosn(e,RCSID,__LINE__)
#define SetErrPosnC(e)   _SetErrPosnC(e,RCSID,__LINE__)
#define SetErrPosnGoto(e)   { err=SetErrPosn(e); goto Error; }
#define SetErrPosnGotoC(e)   { err=SetErrPosnC(e); goto Error; }

Functions

LIBEXPORT void ClearLastErr (void)
LIBEXPORT const MIUNICODEGetErrDetails ()
LIBEXPORT MISTRINGGetErrString ()
LIBEXPORT const MIUNICODEGetErrStrLine1UC (ERRVALUE errcode, int *errlevel=0)
LIBEXPORT const MIUNICODEGetErrStrUC (ERRVALUE errcode, int *errlevel=0)
LIBEXPORT ERRVALUE GetLastErrCode ()
LIBEXPORT bool IsErrPosnDisabled ()
LIBEXPORT void SetErrDetails (const MIUNICODE *)
LIBEXPORT void SetErrPosnDisable (void)
LIBEXPORT void SetErrPosnEnable (void)

Define Documentation

#define SetErrPosn (  )     _SetErrPosn(e,RCSID,__LINE__)

Record an error code and it's position.

Note, this is really a macro which calls an internal function and also passes it RCSID and __LINE__ For this to work, the following line must exist near the top of the module (just below the main comment block)

    #define RCSID "$Id: errhandler.h_v 1.6 2008/09/08 13:22:14 mju Exp $"

Note: The example above shows what the RCSID for this include file looks like. If you're using RCS, it will fill in everything between the Id: and the $. The actual source module will be specific to the file in which RCSID is defined, and will be extracted from the RCSID string along with the revision number and date for display in error traces.

#define SetErrPosnC (  )     _SetErrPosnC(e,RCSID,__LINE__)

Clear current error stack and set error position.

Same as SetErrPosn(), but clears the error stack first.

See also:
SetErrPosn()
#define SetErrPosnGoto (  )     { err=SetErrPosn(e); goto Error; }

Set the current error position and goto Error label.

Note, This is really a macro.

It does the same thing as SetErrPosn(), then does a goto Error;

#define SetErrPosnGotoC (  )     { err=SetErrPosnC(e); goto Error; }

Clear the error stack, set the current error position and goto Error label.

Note, This is really a macro. It does the same thing as SetErrPosnC(), then does a goto Error;


Function Documentation

LIBEXPORT void ClearLastErr ( void   ) 

Clear the last reported error and the error stack.

LIBEXPORT const MIUNICODE* GetErrDetails (  ) 

Get the details string set by SetErrDetails().

Do not free the returned string.

LIBEXPORT MISTRING& GetErrString (  ) 

Get MISTRING reference to current error message.

This allows subsequent use of the << operator on the string to substitute or append additional error values for -format or $-position codes.

LIBEXPORT const MIUNICODE* GetErrStrLine1UC ( ERRVALUE  errcode,
int *  errlevel = 0 
)

Get the first line of the last error message (Unicode).

Do not free the returned string.

Parameters:
errcode Error code to retrieve string for
errlevel Error level returned (NULL if don't care)
LIBEXPORT const MIUNICODE* GetErrStrUC ( ERRVALUE  errcode,
int *  errlevel = 0 
)

Get the last error message (Unicode).

Do not free the returned string.

Parameters:
errcode Error code to retrieve string for
errlevel Error level returned (NULL if don't care)
LIBEXPORT ERRVALUE GetLastErrCode (  ) 

Get last error code.

LIBEXPORT bool IsErrPosnDisabled (  ) 

Determine if error position recording is disabled.

Returns:
true if disabled, false if not.
LIBEXPORT void SetErrDetails ( const MIUNICODE  ) 

Set the details string for an error.

This can be used to report any extra details about an error. If set, the standard error dialog will have a "detail..." button which will let the user see the details.

LIBEXPORT void SetErrPosnDisable ( void   ) 

Disable error position reporting.

This is important when cleaning up after an error. It often happens that if you get an error, you need to cleanup (close files, etc) before returning. If something in your cleanup code also causes an error, it will wipe out the error trace that you're trying to report. Therefore, always bracket cleanup code with SetErrPosnDiaable()/SetErrPosnEnable().

LIBEXPORT void SetErrPosnEnable ( void   ) 

Reenable error position reporting.

See also:
SetErrPosnDisable()

Generated on Sun Oct 7 21:33:02 2012 for TNTsdk 2012 by  doxygen 1.6.1