Skip to content

Commit

Permalink
* added remarks regaring error handling if file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgraf committed May 24, 2020
1 parent 8489060 commit 34a3c49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vector-extractor/VectorExtractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ get_features_near_position(const char *path, double pos_x, double pos_y, double
poDS = (GDALDataset *) GDALOpenEx(path, GDAL_OF_VECTOR, nullptr,
nullptr, nullptr);
if (poDS == nullptr) {
// FIXME: we have to handle this differently - this kills godot! We should implement a proper error
// FIXME: handling here and give the calling godot code the possibility to react to the error and
// FIXME: deside itself what to do (including output to the console)
printf("Open failed.\n");
exit(1);
}
Expand Down Expand Up @@ -84,6 +87,9 @@ VectorExtractor::crop_lines_to_square(const char *path, double top_left_x, doubl
poDS = (GDALDataset *) GDALOpenEx(path, GDAL_OF_VECTOR, nullptr,
nullptr, nullptr);
if (poDS == nullptr) {
// FIXME: we have to handle this differently - this kills godot! We should implement a proper error
// FIXME: handling here and give the calling godot code the possibility to react to the error and
// FIXME: deside itself what to do (including output to the console)
printf("Open failed.\n");
exit(1);
}
Expand Down

0 comments on commit 34a3c49

Please sign in to comment.