|
CLASS moError
NAME
Constructors - initialize an error object
private:
Init - initialize an error object
VERSION
Version: 1.2.0
SYNOPSIS
moError(const char *format, ...);
moError(int err_num, const char *format, ...);
moError(const moError& err);
moError& operator = (const moError& err);
virtual ~moError();
private:
void Init(int err_num, const char *format, void *params);
PARAMETERS
err_num - the error number for easy testing
format - a standard printf(3) format string
... - the format parameters
err - another moError object to duplicate
DESCRIPTION
Create or copy error objects.
By default this object is silent. With the use of the MODEBUG
variable, it is possible to get the errors printed on the
screen as they are created. Note that duplicated (copy operators)
errors are not printed out.
The corresponding catch can use the Errno() to indentify the
error and the Message() field to print out the error if necessary.
The error number (err_num) should be used as much as possible.
It needs to be used with unique numbers. The system defines its
own error numbers in the mo_base.h header file. The end users can
start their error numbers from the MO_ERROR_USER_NUMBER value up.
EXAMPLES
This object is usually created when an error needs to be thrown
as in the following example:
throw moError(MO_ERROR_OVERFLOW,
"Stack full (max %d items)", max_items);
NOTES
This object allocates memory and should never be used when
a memory problem occurs. Use a throw long(MO_ERROR_MEMORY)
instead.
SEE ALSO
Errno, Message
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
Links:
molib
the sandbox
|