Skip to content

Commit

Permalink
Improve error messages when tools attempt to use non-enabled S3 and H…
Browse files Browse the repository at this point in the history
…DFS VFDs. (HDFGroup#4047)
  • Loading branch information
lrknox committed Mar 4, 2024
1 parent 30a2f20 commit 75a165b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/libtest/h5tools_test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ test_populate_ros3_fa(void)

#ifndef H5_HAVE_ROS3_VFD
puts(" -SKIP-");
puts(" Read-Only S3 VFD not enabled");
puts(" Test is skipped unless HDF5 is configured and built with the Read-Only S3 VFD enabled.");
fflush(stdout);
return 0;
#else
Expand Down
5 changes: 3 additions & 2 deletions tools/src/h5dump/h5dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,8 @@ parse_command_line(int argc, const char *const *argv)

vfd_info_g.info = &ros3_fa_g;
#else
error_msg("Read-Only S3 VFD not enabled.\n");
error_msg(
"Read-Only S3 VFD is not available unless enabled when HDF5 is configured and built.\n");
h5tools_setstatus(EXIT_FAILURE);
goto done;
#endif
Expand All @@ -1188,7 +1189,7 @@ parse_command_line(int argc, const char *const *argv)

vfd_info_g.info = &hdfs_fa_g;
#else
error_msg("HDFS VFD not enabled.\n");
error_msg("HDFS VFD is not available unless enabled when HDF5 is configured and built.\n");
h5tools_setstatus(EXIT_FAILURE);
goto done;
#endif
Expand Down
7 changes: 5 additions & 2 deletions tools/src/h5ls/h5ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -2858,7 +2858,8 @@ main(int argc, char *argv[])

vfd_info.info = &ros3_fa;
#else
fprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n");
fprintf(rawerrorstream, "Error: Read-Only S3 VFD is not available unless enabled when HDF5 is "
"configured and built.\n\n");
usage();
leave(EXIT_FAILURE);
#endif
Expand All @@ -2881,7 +2882,9 @@ main(int argc, char *argv[])

vfd_info.info = &hdfs_fa;
#else
fprintf(rawerrorstream, "Error: The HDFS VFD is not enabled\n\n");
fprintf(
rawerrorstream,
"Error: The HDFS VFD is not available unless enabled when HDF5 is configured and built.\n\n");
usage();
leave(EXIT_FAILURE);
#endif
Expand Down
5 changes: 3 additions & 2 deletions tools/src/h5stat/h5stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,8 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re

drivername = drivernames[ROS3_VFD_IDX];
#else
error_msg("Read-Only S3 VFD not enabled.\n");
error_msg(
"Read-Only S3 VFD is not available unless enabled when HDF5 is configured and built.\n");
goto error;
#endif
break;
Expand All @@ -961,7 +962,7 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re

drivername = drivernames[HDFS_VFD_IDX];
#else
error_msg("HDFS VFD not enabled.\n");
error_msg("HDFS VFD is not available unless enabled when HDF5 is configured and built.\n");
goto error;
#endif
break;
Expand Down

0 comments on commit 75a165b

Please sign in to comment.