Tools: Error messages

This commit is contained in:
Shahram Najm 2024-01-03 16:30:36 +00:00
parent f80aa163f1
commit 7e9a6b4078
2 changed files with 2 additions and 0 deletions

View File

@ -113,6 +113,7 @@ int grib_tool_init(grib_runtime_options* options)
grib_handle* hh; grib_handle* hh;
FILE* f = fopen(options->latlon_mask, "r"); FILE* f = fopen(options->latlon_mask, "r");
if (!f) { if (!f) {
fprintf(stderr, "%s: unable to open mask file %s\n", tool_name, options->latlon_mask);
perror(options->latlon_mask); perror(options->latlon_mask);
exit(1); exit(1);
} }

View File

@ -137,6 +137,7 @@ int grib_tool_init(grib_runtime_options* options)
int idx_overall = -1; int idx_overall = -1;
FILE* f = fopen(options->latlon_mask, "r"); FILE* f = fopen(options->latlon_mask, "r");
if (!f) { if (!f) {
fprintf(stderr, "%s: unable to open mask file %s\n", tool_name, options->latlon_mask);
perror(options->latlon_mask); perror(options->latlon_mask);
exit(1); exit(1);
} }