Error messages

This commit is contained in:
Shahram Najm 2023-12-31 18:19:42 +00:00
parent 40f7a0007d
commit 8cb098cd95
2 changed files with 11 additions and 11 deletions

View File

@ -484,7 +484,7 @@ static int pack_double_array_as_long(grib_accessor* a, const double* v, size_t*
size_t numBytes = *len * (sizeof(long));
long* lValues = (long*)grib_context_malloc(c, numBytes);
if (!lValues) {
grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %ld bytes\n", numBytes);
grib_context_log(c, GRIB_LOG_ERROR, "Unable to allocate %ld bytes", numBytes);
return GRIB_OUT_OF_MEMORY;
}
for (i = 0; i < *len; i++)

View File

@ -642,7 +642,7 @@ static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data,
if (grib_decode_unsigned_byte_long(secbegin, 5, 1) == 254) {
if (!gm->bitmap_section) {
grib_context_log(c, GRIB_LOG_ERROR,
"grib_handle_new_multi : cannot create handle, missing bitmap\n");
"grib_handle_new_multi : cannot create handle, missing bitmap");
return NULL;
}
gm->sections[secnum] = gm->bitmap_section;
@ -695,7 +695,7 @@ static grib_handle* grib_handle_new_multi(grib_context* c, unsigned char** data,
gl = grib_handle_new_from_message(c, message, olen);
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_multi: cannot create handle \n");
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_multi: cannot create handle");
return NULL;
}
@ -794,7 +794,7 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in
/* Special case for inherited bitmaps */
if (grib_decode_unsigned_byte_long(secbegin, 5, 1) == 254) {
if (!gm->bitmap_section) {
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle, missing bitmap\n");
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle, missing bitmap");
grib_context_free(c, data);
return NULL;
}
@ -850,7 +850,7 @@ static grib_handle* grib_handle_new_from_file_multi(grib_context* c, FILE* f, in
gl = grib_handle_new_from_message(c, data, olen);
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle \n");
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_multi: cannot create handle");
grib_context_free(c, data);
return NULL;
}
@ -930,7 +930,7 @@ grib_handle* gts_new_from_file(grib_context* c, FILE* f, int* error)
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "gts_new_from_file: cannot create handle \n");
grib_context_log(c, GRIB_LOG_ERROR, "gts_new_from_file: cannot create handle");
grib_context_free(c, data);
return NULL;
}
@ -971,7 +971,7 @@ grib_handle* taf_new_from_file(grib_context* c, FILE* f, int* error)
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "taf_new_from_file: cannot create handle \n");
grib_context_log(c, GRIB_LOG_ERROR, "taf_new_from_file: cannot create handle");
grib_context_free(c, data);
return NULL;
}
@ -1012,7 +1012,7 @@ grib_handle* metar_new_from_file(grib_context* c, FILE* f, int* error)
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "metar_new_from_file: cannot create handle \n");
grib_context_log(c, GRIB_LOG_ERROR, "metar_new_from_file: cannot create handle");
grib_context_free(c, data);
return NULL;
}
@ -1080,7 +1080,7 @@ grib_handle* bufr_new_from_file(grib_context* c, FILE* f, int* error)
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "bufr_new_from_file: cannot create handle \n");
grib_context_log(c, GRIB_LOG_ERROR, "bufr_new_from_file: cannot create handle");
grib_context_free(c, data);
return NULL;
}
@ -1132,7 +1132,7 @@ grib_handle* any_new_from_file(grib_context* c, FILE* f, int* error)
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "any_new_from_file : cannot create handle\n");
grib_context_log(c, GRIB_LOG_ERROR, "any_new_from_file: cannot create handle");
grib_context_free(c, data);
return NULL;
}
@ -1205,7 +1205,7 @@ static grib_handle* grib_handle_new_from_file_no_multi(grib_context* c, FILE* f,
if (!gl) {
*error = GRIB_DECODING_ERROR;
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_no_multi: cannot create handle\n");
grib_context_log(c, GRIB_LOG_ERROR, "grib_handle_new_from_file_no_multi: cannot create handle");
grib_context_free(c, data);
return NULL;
}