Open chrisgraf opened 4 years ago
Thanks for the remarks! Should we just return null and leave the error handling to the GDScript code? (+ output a proper Godot Error)
That would be consistent with GDScript's load
and preload
functions, for example.
Yes, the error should be handled where we have our "proper" logging and the code has enough information to estimate the impact of the failed call. So handling this in GDScript seems correct to me.
The crash should be prevented with https://github.com/boku-ilen/geodot-plugin/commit/c7c60647e8f1f139b519f1e9d28415ef73f3e1b6 - an empty list is returned if the dataset is invalid. Currently, an error is printed to the console saying that the dataset couldn't be opened, but we'd want to get this error into Godot. We might need to use Exceptions for this. They're not commonly used in game development, so I'm not sure whether we want to bring them into Geodot?
Seems like with GDExtension there are ways to properly propagate errors to Godot like ERR_FAIL_V_MSG
(see the Godot XR reference project https://github.com/GodotVR/godot_xr_reference/blob/master/src/xr_interface_reference.cpp)
see discord and remarks in https://github.com/boku-ilen/geodot-plugin/commit/34a3c4956d9e89b12c17b98638b445f11a9197c1