The function ex_err() logs an error to stderr
. It is intended to provide explanatory messages for error codes returned from other exodus routines.
The passed in error codes and corresponding messages are listed in ???. The programmer may supplement the error message printed for standard errors by providing an error message. If the error code is provided with no error message, the predefined message will be used. The error code EX_MSG
is available to log application specific messages.
- Parameters:
-
[in] | module_name | This is a string containing the name of the calling function. |
[in] | message | This is a string containing a message explaining the error or problem. If EX_VERBOSE (see ex_opts()) is true, this message will be printed to stderr . Otherwise, nothing will be printed. Maximum length is MAX_ERR_LENGTH . |
[in] | err_num | This is an integer code identifying the error. exodus C functions place an error code value in exerrval , an external int. Negative values are considered fatal errors while positive values are warnings. There is a set of predefined values defined in exodusII.h . The predefined constant EX_PRTLASTMSG will cause the last error message to be output, regardless of the setting of the error reporting level (see ex_opts()). |
The following is an example of the use of this function:
#include "exodusII.h"
int exoid, CPU_word_size, IO_word_size, errval;
float version;
char errmsg[MAX_ERR_LENGTH];
CPU_word_size = sizeof(float);
IO_word_size = 0;
\comment{open exodus file}
if (exoid = ex_open ("test.exo", EX_READ, &CPU_word_size,
&IO_word_size, &version)) {
errval = 999;
sprintf(errmsg,"Error: cannot open file test.exo");
ex_err("prog_name", errmsg, errval);
}