How should I handle exceptions in my plugins? I tried using various libraries and in some cases they can break Godot, which leads to the program crashing.
Crash handling in GDExtension plugin
O3ZY changed the title to Crash handling in GDExtension plugin .
Don't intentionally throw exceptions from your plugin unless there's no other recourse. If you are calling into a library function that is unsafe, it makes sense IMO to try/catch around that, but otherwise it's better to predict possible errors, do good type/null/etc checking, and print the error and return null/empty/ERROR_CODE/etc if there's an issue.
If you're on Windows, you can try using Windows OS function 'SetUnhandledExceptionFilter' to catch the error.
Example: https://www.codeproject.com/articles/154686/setunhandledexceptionfilter-and-the-c-c-runtime-li
award It's Assimp and function is ReadFile from Importer
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
...
const aiScene* scene = importer.ReadFile(path,
aiProcess_GlobalScale |
aiProcess_OptimizeMeshes |
aiProcess_LimitBoneWeights |
aiProcess_JoinIdenticalVertices |
aiProcess_Triangulate);