From 99ca727263bfadec7733758fab252345c707fddc Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 14 Aug 2024 16:48:25 -0600 Subject: [PATCH] EXODUS: Clean up some error message output --- packages/seacas/libraries/exodus/include/exodusII.h | 1 + packages/seacas/libraries/exodus/src/ex_err.c | 4 +++- packages/seacas/libraries/exodus/src/ex_open.c | 4 ++-- packages/seacas/libraries/exodus/src/ex_open_par.c | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/seacas/libraries/exodus/include/exodusII.h b/packages/seacas/libraries/exodus/include/exodusII.h index 45b897e6f7..8c978d67aa 100644 --- a/packages/seacas/libraries/exodus/include/exodusII.h +++ b/packages/seacas/libraries/exodus/include/exodusII.h @@ -1955,6 +1955,7 @@ enum ex_error_return_code { EX_LASTERR = -1003, /**< in ex_err, use existing err_num value */ EX_NULLENTITY = -1006, /**< null entity found */ EX_NOENTITY = -1007, /**< no entities of that type on database */ + EX_INTSIZEMISMATCH = -1008, /**< integer sizes do not match on input/output databases in ex_copy */ EX_NOTFOUND = -1008, /**< could not find requested variable on database */ EX_FATAL = -1, /**< fatal error flag def */ diff --git a/packages/seacas/libraries/exodus/src/ex_err.c b/packages/seacas/libraries/exodus/src/ex_err.c index e3d95e4f01..a2400ab978 100644 --- a/packages/seacas/libraries/exodus/src/ex_err.c +++ b/packages/seacas/libraries/exodus/src/ex_err.c @@ -333,7 +333,8 @@ const char *ex_strerror(int err_num) case EX_MEMFAIL: return "Memory allocation failure"; case EX_BADFILEMODE: return "Bad file mode -- cannot specify both EX_READ and EX_WRITE"; case EX_BADFILEID: return "Bad file id. Could not find exodus file associated with file id."; - case EX_WRONGFILETYPE: return "Integer sizes must match for input and output file in ex_copy."; + case EX_WRONGFILETYPE: + return "File does not exist or is not of a supported type (netcdf3, netcdf4, netcdf5)."; case EX_LOOKUPFAIL: return "Id lookup failed for specified entity type. Could not find entity with specified id."; case EX_BADFILENAME: return "Empty or null filename specified."; @@ -344,6 +345,7 @@ const char *ex_strerror(int err_num) case EX_INTERNAL: return "Internal logic error in exodus library."; case EX_NOTROOTID: return "File id is not the root id; it is a subgroup id."; case EX_NULLENTITY: return "Null entity found."; + case EX_INTSIZEMISMATCH: return "Integer sizes must match for input and output file in ex_copy."; case EX_MSG: return "Message printed; no error implied."; default: return nc_strerror(err_num); } diff --git a/packages/seacas/libraries/exodus/src/ex_open.c b/packages/seacas/libraries/exodus/src/ex_open.c index dd16d5ac87..baac050f4a 100644 --- a/packages/seacas/libraries/exodus/src/ex_open.c +++ b/packages/seacas/libraries/exodus/src/ex_open.c @@ -253,8 +253,8 @@ int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *ver EX_FUNC_LEAVE(EX_FATAL); } snprintf(errmsg, MAX_ERR_LENGTH, - "ERROR: failed to open %s of type %d for reading.\n\tEither " - "the file does not exist,\n\tor there is a permission or file " + "ERROR: failed to open %s of type %d for reading.\n\t\tThe " + "file does not exist, or there is a permission or file " "format issue.", canon_path, type); ex_err(__func__, errmsg, status); diff --git a/packages/seacas/libraries/exodus/src/ex_open_par.c b/packages/seacas/libraries/exodus/src/ex_open_par.c index 1f4c5a1d39..5bfad214c0 100644 --- a/packages/seacas/libraries/exodus/src/ex_open_par.c +++ b/packages/seacas/libraries/exodus/src/ex_open_par.c @@ -291,9 +291,9 @@ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float } snprintf(errmsg, MAX_ERR_LENGTH, - "ERROR: failed to open %s for read/write.\n\tEither the file " - "does not exist,\n\tor there is a permission or file format " - "issue.", + "ERROR: failed to open %s of type %d for reading.\n\t\tThe " + "file does not exist, or there is a permission or file " + "format issue.", canon_path); ex_err(__func__, errmsg, status); free(canon_path);