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

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

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);