Issue #189 throw a more useful, less fatal error when grib data is loaded into a grid resource.

Former-commit-id: 13932f9c1f [formerly 2fcaf9ff60] [formerly 96ca3108a4 [formerly 74e1f6e724627f452c808173be2968053f7dd6f9]]
Former-commit-id: 96ca3108a4
Former-commit-id: d217ea2e21
This commit is contained in:
Ben Steffensmeier 2012-10-19 11:53:22 -05:00
parent f7b3cbdef7
commit b234c6fcbf

View file

@ -134,7 +134,13 @@ public class GridResourceData extends AbstractRequestableResourceData implements
throws VizException {
records = new GridRecord[objects.length];
for (int i = 0; i < objects.length; i++) {
records[i] = (GridRecord) objects[i];
if (objects[i] instanceof GridRecord) {
records[i] = (GridRecord) objects[i];
} else {
throw new IllegalArgumentException(
"GridResourceData only supports data stored in grid format, not "
+ objects[i].getPluginName() + " data");
}
}
sampling = sampling == null ? false : sampling;
return new D2DGridResource(this, loadProperties);