Tools: Error messages

This commit is contained in:
Shahram Najm 2024-01-10 17:08:29 +00:00
parent 78aa519961
commit 9c693eabab
3 changed files with 3 additions and 2 deletions

View File

@ -86,7 +86,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil
printf("--- %s: processing %s\n", tool_name, file);
ret = grib_index_add_file(idx, file);
if (ret) {
printf("error: %s\n", grib_get_error_message(ret));
fprintf(stderr, "Error: %s\n", grib_get_error_message(ret));
exit(ret);
}
return 0;

View File

@ -75,6 +75,7 @@ int main(int argc, char* argv[])
fout = fopen(out_file, "wb");
if (!fout) {
fprintf(stderr, "Failed to open output file '%s'\n", out_file);
perror(out_file);
return 1;
}
fin = codes_fopen(full_path, "r");

View File

@ -83,7 +83,7 @@ int grib_tool_new_filename_action(grib_runtime_options* options, const char* fil
printf("--- %s: processing %s\n", tool_name, file);
ret = grib_index_add_file(idx, file);
if (ret) {
printf("error: %s\n", grib_get_error_message(ret));
fprintf(stderr, "Error: %s\n", grib_get_error_message(ret));
exit(ret);
}
return 0;