Skip to content

Commit

Permalink
EXODUS: Clean up some error message output
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Aug 14, 2024
1 parent f7d10a9 commit 99ca727
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/seacas/libraries/exodus/include/exodusII.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 3 additions & 1 deletion packages/seacas/libraries/exodus/src/ex_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/libraries/exodus/src/ex_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions packages/seacas/libraries/exodus/src/ex_open_par.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 99ca727

Please sign in to comment.