diff --git a/applications/utilities/gridToSTL/gridToSTL.C b/applications/utilities/gridToSTL/gridToSTL.C index 3aa68c4bb841c7c44ee8b9f3f4d2a999299c8235..2548def7063c22da04c0319234c5ad15a65ac97d 100644 --- a/applications/utilities/gridToSTL/gridToSTL.C +++ b/applications/utilities/gridToSTL/gridToSTL.C @@ -596,14 +596,14 @@ int main(int argc, char *argv[]) if (! shp.read(shapeBoundary)) { - FatalIOErrorIn("gridToSTL.C", gridToSTLDict) + FatalIOErrorIn("gridToSTL", gridToSTLDict) << "Unable to read shapefile " << shapeBoundary << "." << exit(FatalIOError); } if (shp.shptype() != shapefile::POLYLINE && shp.shptype() != shapefile::POLYGON) { - FatalIOErrorIn("gridToSTL.C", gridToSTLDict) + FatalIOErrorIn("gridToSTL", gridToSTLDict) << "Boundary shapefile must be of type POLYLINE or POLYGON." << exit(FatalIOError); } @@ -620,7 +620,7 @@ int main(int argc, char *argv[]) if (polyIndex < 0) { - FatalIOErrorIn("gridToSTL.C", gridToSTLDict) + FatalIOErrorIn("gridToSTL", gridToSTLDict) << "Boundary shapefile contains no usable record." << exit(FatalIOError); } @@ -651,7 +651,7 @@ int main(int argc, char *argv[]) } else { - FatalIOErrorIn("gridToSTL.C", gridToSTLDict) + FatalIOErrorIn("gridToSTL", gridToSTLDict) << "Boundary \"" << boundary << "\" not known. Please choose \"fromShape\" or \"fromPoints\"" << exit(FatalIOError); @@ -674,7 +674,12 @@ int main(int argc, char *argv[]) Info << "Reading grid file" << endl; gridfile grid; - grid.read(gridName); + if (!grid.read(gridName)) + { + FatalIOErrorIn("gridToSTL", gridToSTLDict) + << "Could not read grid file " << gridName + << exit(FatalIOError); + } bTri.exportSTL(stlName, grid, divisions, domainHeight);