Error Reporting Functions

:Associate with "Error Reporting Functions" More...

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 UNICODEGetErrDetails ()
LIBEXPORT MISTRINGGetErrString ()
LIBEXPORT const UNICODEGetErrStrLine1UC (ERRVALUE errcode, int *errlevel=0)
LIBEXPORT const UNICODEGetErrStrUC (ERRVALUE errcode, int *errlevel=0)
LIBEXPORT ERRVALUE GetLastErrCode ()
LIBEXPORT bool IsErrPosnDisabled ()
LIBEXPORT void SetErrDetails (const UNICODE *)
LIBEXPORT void SetErrPosnDisable (void)
LIBEXPORT void SetErrPosnEnable (void)

Detailed Description

:Associate with "Error Reporting Functions"


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: miodefns.h_v 1.177 2004/07/15 14:24:36 dwilliss 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 $. If you're not using RCS, change miodefns.h to the name of the source module. The number after that is the revision number which TNT will show in the error message. The rest of the RCSID is ignored.

Definition at line 333 of file miodefns.h.

#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()

Definition at line 340 of file miodefns.h.

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

Set the current error position and goto Error label.

Note, This is really a #define macro.

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

Definition at line 349 of file miodefns.h.

#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 #define macro. It does the same thing as SetErrPosnC(), then does a goto Error;

Definition at line 356 of file miodefns.h.


Function Documentation

LIBEXPORT void ClearLastErr void   ) 
 

Clear the last reported error and the error stack.

LIBEXPORT const UNICODE* 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 UNICODE* 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 UNICODE* 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 UNICODE  ) 
 

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 "detial..." 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 Tue Dec 14 13:20:26 2004 for TNTsdk by  doxygen 1.3.8-20040913