Success/Error Code

This page describes the Success/Error Code values returned by AMA Spline Library Functions.

It is separated into sections associated with the Success/Error Code values. In each section a brief description of the message associated with the error code is provided. A list of the terms used in the descriptions is given below.

All AMA Spline Library Functions return one of the following Success/Error Code values:

Additionally, if AMA_OPTIONS::errorFlag equals AMA_ErrorFlag_Enabled, then AMA Spline Library Functions write a descriptive Message to AMA_OPTIONS::errorFp. For example, if AMA_UnvApprox() is invoked with degree = -1, then AMA_UnvApprox() writes the error message

AMA_INPUT_ERROR: Function AMA_UnvApprox; degree equals = -1; Must satisfy 1 <= degree <= 5. 

to the file referenced by AMA_OPTIONS::errorFp.

AMA Initialization Error

If AMA_Options() is not invoked prior to calling an AMA Function, then that function reports an initialization error. For example, if AMA_UnvApprox() is invoked without first calling AMA_Options(); then AMA_UnvApprox() reports the error

INPUT_ERROR: Function AMA_UnvApprox: Called out of sequence - Must call AMA_Options first.

AMA_ALLOCATE_ERROR

A memory allocation error occurred within an AMA Function and insufficient memory is available to continue. See AMA_ALLOCATE_ERROR for its value. The form of an allocation error message is

AMA_MEMORY_ALLOCATION_ERROR: Function FunctionName: Allocating: PointerName; Type: PointerType; Size: PointerSize; File FileName; Line IntValue. 

If an AMA_ALLOCATE_ERROR occurs within an AMA Function, then the function does not continue and it returns the maximum of AMA_ALLOCATE_ERROR and the Success/Error Code produced by all functions called before the allocation error occurred. Additionally, the function produces a traceback message whenever an AMA_ALLOCATE_ERROR occurs. The form of a traceback message is

AMA_ERROR_TRACEBACK: Function Function1: Called: FunctionName; File FileName; Line IntValue.
AMA_ERROR_TRACEBACK: Function Function2: Called: Function1; File FileName; Line IntValue.
                               .
                               .
AMA_ERROR_TRACEBACK: Function FunctionN: Called: FunctionM; File FileName; Line IntValue.

The user should either scale down the approximation problem or acquire additional memory in order to proceed.

AMA_FATAL_ERROR

Either an invalid value for an input parameter is passed to an AMA Function or an AMA Function attempted to perform an invalid operation. In the former case, the input parameter is defined within the AMA Function and is not related to user input. See AMA_FATAL_ERROR for its value. The form of a fatal error message is

AMA_FATAL_ERROR: Function FunctionName: Message; File FileName; Line IntValue. 

If an AMA_FATAL_ERROR occurs within an AMA Function, then the function does not continue and it returns the maximum of AMA_FATAL_ERROR and the Success/Error Code produced by all functions called before the fatal error occurred. Additionally, the function produces a traceback message whenever an AMA_FATAL_ERROR occurs. The form of a traceback message is

AMA_ERROR_TRACEBACK: Function Function1: Called: FunctionName; File FileName; Line IntValue.
AMA_ERROR_TRACEBACK: Function Function2: Called: Function1; File FileName; Line IntValue.
                               .
                               .
AMA_ERROR_TRACEBACK: Function FunctionN: Called: FunctionM; File FileName; Line IntValue.                               .

All AMA_FATAL_ERROR errors should be reported to the program developer.

AMA_INPUT_ERROR

An invalid value for an input parameter is passed to an AMA Function. See AMA_INPUT_ERROR for its value. If the input parameter is related to user input, then the form of an input error message is

AMA_INPUT_ERROR: Function FunctionName: Message. 

The input parameter referenced in Message should be corrected and the function invoked again. However, if the input parameter is set within an AMA Function, then the form of the error message is

AMA_INPUT_ERROR: Function FunctionName: Message.
AMA_ERROR_TRACEBACK: Function Function1: Called: FunctionName; File FileName; Line IntValue.
AMA_FATAL_ERROR: Function Function1.

All input errors which cause an AMA_FATAL_ERROR error should be reported to the program developer.

If an AMA_INPUT_ERROR occurs within an AMA Function, then the function does not continue and it returns the maximum of AMA_INPUT_ERROR and the Success/Error Code produced by all functions called before the input error occurred.

AMA_NO_ERROR

An AMA Function was successful and no error message is produced. See AMA_NO_ERROR for its value. If the function returns AMA_NO_ERROR, then the function was successful.

AMA_PROCESS_ERROR

A numerical error occurred within an AMA Function. See AMA_PROCESS_ERROR for its value. The form of a process error message is

AMA_PROCESS_ERROR: Function FunctionName: Message 

If either an AMA_PROCESS_ERROR or an AMA_WARNING_ERROR occurs and only those errors occur, then the function completes its operation but the user should check the results.

AMA_WARNING_ERROR

A non-fatal error which may be related to user input occurred or the results are suspect. See AMA_WARNING_ERROR for its value. The form of a warning message is

AMA_WARNING: Function FunctionName: Message 

If either an AMA_PROCESS_ERROR or an AMA_WARNING_ERROR occurs and only those errors occur, then the function completes its operation but the user should check the results.