Error class

The Error class provides configuration options for the error reporting module of the HLU library.


Synopsis

Header file:		ncarg/hlu/hlu.h
Class name:		errorClass
Class pointer:		<Not referenceable>
Fortran class function:	<Not referenceable>
Superclass:		Base
Composite classes:	<None>

Name:			Error
Note: Only one error object is created for an hlu program, and it is always named Error.

Class Defined Types

Type name:		NhlTErrorTypes
Definition:
typedef enum _NhlErrType{
	NhlFATAL	= -4,	/* "FATAL"	*/
	NhlWARNING	= -3,	/* "WARNING"	*/
	NhlINFO		= -2,	/* "INFO"	*/
	NhlNOERROR	= -1	/* "NOERROR"	*/
} NhlErrorTypes;

Resources

Local resources

+---------------------------------------------------------------+
|			Error resource set			|
|---------------------------------------------------------------|
| NAME				TYPE			ACCESS	|
|	CLASS				DEFAULT			|
|===============================================================|
| errBuffer			NhlTBoolean		RSG	|
|       ErrBuffer                       False                   |
|---------------------------------------------------------------|
| errLevel			NhlTErrorTypes		RSG	|
|	ErrLevel			NhlWARNING		|
|---------------------------------------------------------------|
| errPrint                      NhlTBoolean		RSG	|
|       ErrPrint                        True                    |
|---------------------------------------------------------------|
| errFileName			NhlTString		RSG	|
|	ErrFileName			"stderr"		|
|---------------------------------------------------------------|
| *errFilePtr			NhlTPointer		SG	|
|       ErrFilePtr                      NULL                    |
|---------------------------------------------------------------|
| **errUnitNumber		NhlTInteger		RSG	|
|	ErrUnitNumber			74			|
+---------------------------------------------------------------+
* errFilePtr is only valid in "C" mode.
** errUnitNumber is only valid in "Fortran" mode.

Description

This object is used to configure the error-reporting module of the HLU library. It works in conjunction with the Error functions.

The Error object works in two modes: C mode and Fortran mode. Most of the resources work the same in both modes. The errBuffer, errLevel, and errPrint resources are not affected by the language mode.

The language mode that the Error object uses is determined by how the HLU library is initialized. If the library is initialized using the Fortran initialization function NHLFINITIALIZE, or NHLFOPEN, then the Error object uses Fortran mode; otherwise it uses C mode.

C mode

When in C mode, the Error object disables the errUnitNumber resource and uses the errFilePtr resource. If the errFilePtr resource is used, the errFileName resource is set to a NULL string.

Fortran mode

When in Fortran mode, the Error object disables the errFilePtr resource, and uses the errUnitNumber resource. If the errUnitNumber resource is set to a currently open unit, then the errFileName resource is set to NULL. If the unit is not currently open, then the Error object will attempt to open it with the name specified by the errFileName resource. If the errUnitNumber is not set, and the errFileName is set to either "stdout" or "stderr", then the appropriate unit numbers are used in place of the default. These are usually unit 6 and unit 0, respectively.

Support functions

The error-reporting support functions are described in the Error functions reference page.

See also


Copyright

Copyright 1987-1999 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

NCAR Graphics is a registered trademark of the University Corporation for Atmospheric Research.

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.15 $ $Date: 1998/06/15 21:26:58 $