GRIB-864: Improve error messages

This commit is contained in:
Shahram Najm 2015-10-29 17:13:16 +00:00
parent 2b5f2613d9
commit 6fb2bca635
1 changed files with 10 additions and 10 deletions

View File

@ -442,20 +442,20 @@ static int check_handle_against_spec(grib_handle* handle, const long edition, co
lat2 = normalise_angle(lat2);
if (angle_too_small(lat1spec, angular_precision)) {
fprintf(stderr, "Failed to encode latitudeOfFirstGridPointInDegrees %g: less than angular precision\n",lat1spec);
fprintf(stderr, "Failed to encode latitudeOfFirstGridPointInDegrees %.10e: less than angular precision\n",lat1spec);
return GRIB_WRONG_GRID;
}
if (angle_too_small(lat2spec, angular_precision)) {
fprintf(stderr, "Failed to encode latitudeOfLastGridPointInDegrees %g: less than angular precision\n", lat2spec);
fprintf(stderr, "Failed to encode latitudeOfLastGridPointInDegrees %.10e: less than angular precision\n", lat2spec);
return GRIB_WRONG_GRID;
}
if (!DBL_EQUAL(lat1spec, lat1, tolerance)) {
fprintf(stderr, "Failed to encode latitudeOfFirstGridPointInDegrees: spec=%g val=%g\n", lat1spec, lat1);
fprintf(stderr, "Failed to encode latitudeOfFirstGridPointInDegrees: spec=%.10e val=%.10e\n", lat1spec, lat1);
return GRIB_WRONG_GRID;
}
if (!DBL_EQUAL(lat2spec, lat2, tolerance)) {
fprintf(stderr, "Failed to encode latitudeOfLastGridPointInDegrees: spec=%g val=%g\n", lat2spec, lat2);
fprintf(stderr, "Failed to encode latitudeOfLastGridPointInDegrees: spec=%.10e val=%.10e\n", lat2spec, lat2);
return GRIB_WRONG_GRID;
}
}
@ -471,20 +471,20 @@ static int check_handle_against_spec(grib_handle* handle, const long edition, co
lon2 = normalise_angle(lon2);
if (angle_too_small(lon1spec, angular_precision)) {
fprintf(stderr, "Failed to encode longitudeOfFirstGridPointInDegrees %g: less than angular precision\n", lon1spec);
fprintf(stderr, "Failed to encode longitudeOfFirstGridPointInDegrees %.10e: less than angular precision\n", lon1spec);
return GRIB_WRONG_GRID;
}
if (angle_too_small(lon2spec, angular_precision)) {
fprintf(stderr, "Failed to encode longitudeOfLastGridPointInDegrees %g: less than angular precision\n", lon2spec);
fprintf(stderr, "Failed to encode longitudeOfLastGridPointInDegrees %.10e: less than angular precision\n", lon2spec);
return GRIB_WRONG_GRID;
}
if (!DBL_EQUAL(lon1spec, lon1, tolerance)) {
fprintf(stderr, "Failed to encode longitudeOfFirstGridPointInDegrees: spec=%g val=%g\n", lon1spec, lon1);
fprintf(stderr, "Failed to encode longitudeOfFirstGridPointInDegrees: spec=%.10e val=%.10e\n", lon1spec, lon1);
return GRIB_WRONG_GRID;
}
if (!DBL_EQUAL(lon2spec, lon2, tolerance)){
fprintf(stderr, "Failed to encode longitudeOfLastGridPointInDegrees: spec=%g val=%g\n", lon2spec, lon2);
fprintf(stderr, "Failed to encode longitudeOfLastGridPointInDegrees: spec=%.10e val=%.10e\n", lon2spec, lon2);
return GRIB_WRONG_GRID;
}
}
@ -502,11 +502,11 @@ static int check_handle_against_spec(grib_handle* handle, const long edition, co
lonp = normalise_angle(lonp);
if (!DBL_EQUAL(latspec, latp, tolerance)) {
fprintf(stderr, "Failed to encode latitudeOfSouthernPoleInDegrees: spec=%g val=%g\n",latspec,latp);
fprintf(stderr, "Failed to encode latitudeOfSouthernPoleInDegrees: spec=%.10e val=%.10e\n",latspec,latp);
return GRIB_WRONG_GRID;
}
if (!DBL_EQUAL(lonspec, lonp, tolerance)) {
fprintf(stderr, "Failed to encode longitudeOfSouthernPoleInDegrees: spec=%g val=%g\n",lonspec,lonp);
fprintf(stderr, "Failed to encode longitudeOfSouthernPoleInDegrees: spec=%.10e val=%.10e\n",lonspec,lonp);
return GRIB_WRONG_GRID;
}
}