fix: Crash when exceptions are thrown in data processor nodes

This commit is contained in:
WerWolv 2023-09-27 14:19:08 +02:00
parent e80c7bff1c
commit 89bffbd1bc
1 changed files with 6 additions and 3 deletions

View File

@ -542,7 +542,7 @@ namespace hex::plugin::builtin {
// Process the end node
endNode->process();
}
} catch (dp::Node::NodeError &e) {
} catch (const dp::Node::NodeError &e) {
// Handle user errors
// Add the node error to the current workspace, so it can be displayed
@ -552,9 +552,12 @@ namespace hex::plugin::builtin {
for (auto overlay : workspace.dataOverlays)
ImHexApi::Provider::get()->deleteOverlay(overlay);
workspace.dataOverlays.clear();
} catch (std::runtime_error &e) {
} catch (const std::runtime_error &e) {
// Handle internal errors
log::fatal("Node implementation bug! {}", e.what());
log::fatal("Data processor node implementation bug! {}", e.what());
} catch (const std::exception &e) {
// Handle other fatal errors
log::fatal("Unhandled exception thrown in data processor node! {}", e.what());
}
}