intro_application_errors


	Application programmers can create ACNET format error codes that
	are specific to a given application program.  This can be useful
	error conditions detected directly by the application program.
	Instead of displaying a generic CLIB error code, like CBS_GENERR,
	you can generate an error like APPL_HIGH_SLEW_RATE.  These errors
	are handled correctly by all of the CLIB error handling routines
	like error_display(_c) and errhlp(_c) as if they were normal
	CLIB errors.  Application specific errors should be used
	judiciously.  If a system service returns an ACNET format error
	code, you shouldn't simply replace the returned error with one of
	your making.  These errors should be reserved for problems that
	your application code detects itself.

	The way to create application specific errors is to create a
	simple ASCII text file named "application_errors.txt" which
	specifies all of your error codes.  In this file you must specify
	three things for each error code you wish to define.  The first
	parameter is the numeric value for the error which should have a
	value of from -128 to 127.  This should have the form
	"error_code = {error_number}".  The next parameter is the short
	text for the error.  This should have the form
	"error_text = {short_error_text}".  This text will be appended to
	the string "APPL_" to produce the ASCII text representation of the
	error code.  Finally, you enter a verbose description of the
	meaning of the error code which is used by the errhlp(_c) CLIB
	routine to give program users an explanation of the error.  This
	description can be as long as you like.  It has no corresponding
	tag, but must begin on a line by itself.  Comment lines can also
	be included in the error source file.  Comment lines must have as
	their first non white space character either an exclamation point
	(!) or double slashes (//).  Blank lines in the source file are
	ignored.  An example of a portion of an application_errors.txt
	file would be:

	!	Comment line (Comment lines cannot be embedded in the
	!	middle of an error code description.)
	//	another form of comment line (following blank line is ignored)

	error_code = -1		error_text = HIGH_SLEW_RATE
	This error indicates that the program is requesting a slew rate that
	cannot be delivered by the correction elements.  A way to avoid this
	error would be to reduce the constraint on orbit variation from the
	ideal.

	//	End of example file

	When you run MECCA either with the command "mecca {program}" or
	"mecca/dev {program}", MECCA will read the application_errors.txt
	file and build a header file named "application_errors.h" to be
	used by your program as well as entering the error information in
	a database table for use by the CLIB error handling routines.
	The automatically generated header file will have definitions for
	all of your application specific errors in the following form:

	#define	APPL_HIGH_SLEW_RATE	(ERRFAC_APPL + (-1*256))

	Please, note that all application specific errors will use the
	facility code of ERRFAC_APPL.

	See also intro_error.

	Related functions:

	error_init(_c), error_display(_c), error_printf_c, errhlp(_c),
	acnet_error_code, acnet_error_text, acnet_error_description_c,
	clib_sprintf, numeric_to_ascii(_c), ascii_to_numeric(_c)