Detailed Description
With a few exceptions almost all BEAT-II functions return an integer that indicate whether the function was able to perform its operations successfully. The return value will be 0 on success and -1 otherwise. In case you get a -1 you can look at the global variable beatl2_errno for a precise error code. Each error code and its meaning is described in this section. You will also be able to retrieve a character string with an error description via the beatl2_errno_to_string() function. This function will return either the default error message for the error code, or a custom error message. A custom error message will only be returned if the error code you pass to beatl2_errno_to_string() is equal to the last error that occured and if this last error was set with a custom error message. The BEAT-II error state can be set with the beatl2_set_error() function.
Define Documentation
| #define BEATL2_ERROR_CODA (-2000) |
An error occured in the lower level CODA library.
| #define BEATL2_ERROR_DIMENSION_SIZE_MISMATCH (-2121) |
Required array dimension sizes are not equal.
| #define BEATL2_ERROR_FIELD_ALREADY_EXISTS (-2115) |
A field with this name already exists.
| #define BEATL2_ERROR_FILE_OPEN (-2100) |
Could not open product file. This error only occurs for product files that are opened by a BEAT-II ingestion routine and not by the lower level BEAT library (libbeat).
| #define BEATL2_ERROR_FILE_READ (-2101) |
An error occured while reading data from a product file. This error only occurs for product files that are opened by a BEAT-II ingestion routine and not by the lower level BEAT library (libbeat). This error usually indicates that either the product file has an internal inconsistency or that the product is not of the type as indicated by the product_type ingestion filter option.
| #define BEATL2_ERROR_FILE_WRITE (-2102) |
An error occured while writing data to one of the export formats.
| #define BEATL2_ERROR_FILTER_OPTIONS_SYNTAX (-2200) |
Syntax error in filter options string.
| #define BEATL2_ERROR_HDF4 (-2010) |
An error occured in the HDF4 library.
| #define BEATL2_ERROR_HDF5 (-2012) |
An error occured in the HDF5 library.
| #define BEATL2_ERROR_INCOMPATIBLE_FIELDS (-2122) |
Record fields have incompatible attributes (i.e. non matching type, number of dimensions, etc.).
| #define BEATL2_ERROR_INCOMPATIBLE_RECORDS (-2120) |
Records are not of the same type.
| #define BEATL2_ERROR_INVALID_ARGUMENT (-2110) |
| #define BEATL2_ERROR_INVALID_FIELD_INDEX (-2113) |
Record contains no field with this index.
| #define BEATL2_ERROR_INVALID_FIELDNAME (-2112) |
Record contains no field with this fieldname.
| #define BEATL2_ERROR_INVALID_FIELDNAME_FORMAT (-2114) |
Fieldname does not have the proper format to be an identifier.
| #define BEATL2_ERROR_INVALID_FILTER_OPTION (-2201) |
| #define BEATL2_ERROR_INVALID_FILTER_OPTION_VALUE (-2202) |
Invalid value for filter option.
| #define BEATL2_ERROR_INVALID_RECORD_TYPE (-2111) |
The fields within a record are not consistent (e.g. wrong dimensions or wrong data type).
| #define BEATL2_ERROR_MULTIPLE_RECORD_TYPES (-2107) |
Different record types were found, while only one kind of record type was expected.
| #define BEATL2_ERROR_NO_DATA (-2130) |
Operation resulted in no data.
| #define BEATL2_ERROR_NO_HDF4_SUPPORT (-2011) |
No HDF4 support built into BEAT.
| #define BEATL2_ERROR_NO_HDF5_SUPPORT (-2013) |
No HDF5 support built into BEAT.
| #define BEATL2_ERROR_OUT_OF_MEMORY (-2001) |
| #define BEATL2_ERROR_PRODUCT_TYPE_FILTER_OPTION_MISSING (-2204) |
BEAT could not automatically recognize the type of this product. This may indicate that the data was stored using an unsupported product format version. Otherwise, if the product type can only be determined manually, provide a filter option 'product_type' as the first option in the ingestion filter string.
| #define BEATL2_ERROR_PRODUCTFILE_INCONSISTENT (-2105) |
Product file contains an inconsistency.
| #define BEATL2_ERROR_UNSUPPORTED_PRODUCTFILE (-2106) |
Product file of this type not supported. This error message may also appear if you try to open an HDF file and HDF4/HDF5 support was not built into BEAT.
| #define BEATL2_SUCCESS (0) |
Function Documentation
| const char* beatl2_errno_to_string |
( |
const int |
err | ) |
|
Returns a string with the description of the BEAT-II error. If err equals the current BEAT-II error status then this function will return the error message that was last set using beatl2_set_error(). If the error message argument to beatl2_set_error() was NULL or if err does not equal the current BEAT-II error status then the default error message for err will be returned. If beatl2_errno equals BEATL2_ERROR_CODA, BEATL2_ERROR_HDF4, or BEATL2_ERROR_HDF5 this means an error has occured in the lower level CODA, HDF4, or HDF5 library. For these special cases beatl2_errno_to_string() will return (in case the default error message is returned) the error message belonging to the current value of the error code of the CODA/HDF4/HDF5 error (instead of the libbeatl2 error).
- Parameters:
-
- Returns:
- String with a description of the BEAT-II error.
| void beatl2_set_error |
( |
const int |
err, |
|
|
const char * |
message, |
|
|
|
... |
|
) |
| |
Set the error value and optionally set a custom error message. If message is NULL or the empty string then the default error message for the error number will be used. If err equals BEATL2_ERROR_HDF4 then BEAT will automatically store HEvalue(1). If err equals BEATL2_ERROR_HDF5 then BEAT will automatically store the minor error number of the deepest error in the HDF5 error stack.
- Parameters:
-
| err | Value of beatl2_errno. |
| message | Optional error message using printf() format. |
Variable Documentation
Variable that contains the error type. If no error has occurred the variable contains BEATL2_SUCCESS (0).