Merge "Omaha #3469 Improve logging of invalid grib1 files." into omaha_14.4.1

Former-commit-id: 5a7765628b [formerly 8008022af6] [formerly d12e58c56b [formerly 56541a5e8c0e5222b8ae06362a799aab05a76466]]
Former-commit-id: d12e58c56b
Former-commit-id: 30d7205ac2
This commit is contained in:
Richard Peter 2014-07-30 18:02:51 -05:00 committed by Gerrit Code Review
commit 6a8c7811b5

View file

@ -98,6 +98,7 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException;
* Oct 07, 2013 2402 bsteffen Decode GribDecodeMessage instead of
* files.
* Oct 15, 2013 2473 bsteffen Removed deprecated and unused code.
* Jul 30, 2014 3469 bsteffen Improve logging of invalid files.
*
* </pre>
*
@ -164,11 +165,14 @@ public class Grib1Decoder extends AbstractDecoder {
}
return gribRecords.toArray(new GridRecord[] {});
} catch (IOException e) {
throw new GribException("Failed to decode grib1 file: [" + fileName
+ "]", e);
throw new GribException("IO failure decoding grib1 file: ["
+ fileName + "]", e);
} catch (NoValidGribException e) {
throw new GribException(
"Invalid grib1 message: [" + fileName + "]", e);
} catch (Exception e) {
throw new GribException("Unexpected error in grib1 file: ["
+ fileName + "]", e);
} finally {
if (raf != null) {
try {
@ -424,6 +428,9 @@ public class Grib1Decoder extends AbstractDecoder {
}
}
if (data == null) {
throw new GribException("No valid data found in grib record.");
}
if (gdsVars != null) {
correctForScanMode(data, gdsVars.getNx(), gdsVars.getNy(),
bmsPresent, scanMode);
@ -1012,8 +1019,7 @@ public class Grib1Decoder extends AbstractDecoder {
* The value of the level
* @return The converted level type information
*/
private float[] convertGrib1LevelInfo(int ltype1, float lval1,
float lval2) {
private float[] convertGrib1LevelInfo(int ltype1, float lval1, float lval2) {
float level1Type = ltype1;
float level1Scale = 0;
float level1Value = 0;