Skip to content

Commit

Permalink
feat: print error message when trying to load non existent file via g…
Browse files Browse the repository at this point in the history
…eodot.gd
  • Loading branch information
Mathias Baumgartinger~ committed Jan 2, 2024
1 parent e0b0f5f commit 2ce2ba8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions demo/addons/geodot/geodot.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ extends Node


static func get_dataset(path: String, write_access=false) -> GeoDataset:
if not FileAccess.file_exists(path):
push_error("Trying to load non existent file at '%s'" % [path])

var dataset := GeoDataset.new()
dataset.load_from_file(path, write_access)

return dataset


static func get_raster_layer(path: String, write_access=false) -> GeoRasterLayer:
if not FileAccess.file_exists(path):
push_error("Trying to load non existent file at '%s'" % [path])

var layer := GeoRasterLayer.new()
layer.load_from_file(path, write_access)

Expand Down

0 comments on commit 2ce2ba8

Please sign in to comment.