Collaboration diagram for Error Handling:
|
Files | |
| file | psAstronomyErrors.h |
| Contains the error text for the astronomy functions. | |
| file | psCollectionsErrors.h |
| Contains the error text for the collections functions. | |
| file | psFileUtilsErrors.h |
| Contains the error text for the dataIO functions. | |
| file | psDataManipErrors.h |
| Contains the error text for the data manipulation functions. | |
| file | psImageErrors.h |
| Contains the error text for the image functions. | |
| file | psAbort.h |
| Contains the declarations for the abort function. | |
| file | psError.h |
| Contains the declarations for the error reporting functions. | |
| file | psErrorCodes.h |
| Contains the error codes for the error classes. | |
| file | psSysUtilsErrors.h |
| Contains the error text for the system utility functions. | |
Data Structures | |
| struct | psErr |
| Error message object. More... | |
| struct | psErrorDescription |
| An error code with description. More... | |
Enumerations | |
| enum | psErrorCode { PS_ERR_NONE = 0, PS_ERR_BASE = 256, PS_ERR_UNKNOWN, PS_ERR_IO, PS_ERR_LOCATION_INVALID, PS_ERR_MEMORY_CORRUPTION, PS_ERR_MEMORY_DEREF_USAGE, PS_ERR_BAD_PARAMETER_VALUE, PS_ERR_BAD_PARAMETER_TYPE, PS_ERR_BAD_PARAMETER_NULL, PS_ERR_BAD_PARAMETER_SIZE, PS_ERR_UNEXPECTED_NULL, PS_ERR_OS_CALL_FAILED, PS_ERR_N_ERR_CLASSES } |
| enumeration of the static error code classes More... | |
Functions | |
| void | psAbort (const char *name, const char *fmt,...) |
| Reports an abort message to logging facility. | |
| psErr * | psErrorGet (psS32 which) |
| Get a error from the error stack. | |
| psErr * | psErrorLast (void) |
| Get last error put on the error stack. | |
| void | psErrorClear (void) |
| Clears the error stack. | |
| psS32 | psErrorGetStackSize () |
| Get the error stack depth. | |
| void | psErrorStackPrint (FILE *fd, const char *fmt,...) |
| Prints error stack to specified open file descriptor. | |
| void | psErrorStackPrintV (FILE *fd, const char *fmt, va_list va) |
| Prints error stack to specified open file descriptor. | |
| psErrorCode | psError (psErrorCode code, psBool new, const char *fmt,...) |
| Reports an error message to the logging facility. | |
| void | psWarning (const char *fmt,...) |
| Logs a warning message. | |
| psErr * | psErrAlloc (const char *name, psErrorCode code, const char *msg) |
| Create a new psErr struct. | |
| psErrorDescription * | psErrorDescriptionAlloc (psErrorCode code, const char *description) |
| Allocates a new psErrorDescription. | |
| const char * | psErrorCodeString (psErrorCode code) |
| Retrieves the description of an error code. | |
| void | psErrorRegister (const psErrorDescription *errors, psS32 nerror) |
| Register an error code. | |
| psBool | p_psErrorUnregister (psErrorCode code) |
| Clears error codes registered via psErrorRegister. | |
|
|
enumeration of the static error code classes
Definition at line 37 of file psErrorCodes.h. |
|
|
Clears error codes registered via psErrorRegister.
|
|
||||||||||||||||
|
Reports an abort message to logging facility. This function will invoke the psLogMsg function with a level of PS_LOG_ABORT and pass the parameters name and fmt to generate a proper log message. After logging, this function will call system abort function to abnormally terminate the program.
|
|
||||||||||||||||
|
Create a new psErr struct. Creates a new psErr struct, making a copy of the parameters.
|
|
||||||||||||||||||||
|
Reports an error message to the logging facility. This function will invoke the psLogMsg function with a level of PS_LOG_ERROR and pass the parameters name and fmt to generate a proper log message. This function modifies the error stack.
|
|
|
Clears the error stack. The error stack may be completely cleared with psErrorClear. |
|
|
Retrieves the description of an error code. The routine psErrorCodeString returns the string associated with an error code.
|
|
||||||||||||
|
Allocates a new psErrorDescription.
|
|
|
Get a error from the error stack. Previous errors on the stack are returned by psErrorGet (a value of 0 passed to psErrorGet is equivalent to a call to psErrorLast). if no error is at the which position, a non-NULL psErr is returned with code PS_ERR_NONE.
|
|
|
Get the error stack depth.
|
|
|
Get last error put on the error stack. The last error reported is available from psErrorLast; if no errors are current, a non-NULL psErr is returned with code PS_ERR_NONE.
|
|
||||||||||||
|
Register an error code. Any project needed to use psLib must define the necessary error codes and associated message strings. This function registers an array of error codes with the error handling subsystem.
|
|
||||||||||||||||
|
Prints error stack to specified open file descriptor. The entire error stack may be printed to an open file descriptor by calling psErrorStackPrint; if and only if there are current errors, the printf-style string fmt is first printed to the file descriptor fd. In this printout, error codes are replaced by their string equivalents.
|
|
||||||||||||||||
|
Prints error stack to specified open file descriptor. The entire error stack may be printed to an open file descriptor by calling psErrorStackPrintV; if and only if there are current errors, the vprintf-style string fmt is first printed to the file descriptor fd. In this printout, error codes are replaced by their string equivalents.
|
|
||||||||||||
|
Logs a warning message. This procedure logs a message to the destination set by a prior call to psLogSetDestination(), This is equivalent to calling psLogMsg with a level of PS_LOG_WARN.
|
1.4.1