From 89bffbd1bc2a4b55c93a2fff636074057a4a71f4 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 27 Sep 2023 14:19:08 +0200 Subject: [PATCH] fix: Crash when exceptions are thrown in data processor nodes --- .../builtin/source/content/views/view_data_processor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/builtin/source/content/views/view_data_processor.cpp b/plugins/builtin/source/content/views/view_data_processor.cpp index 92f8e7024..25377f5f6 100644 --- a/plugins/builtin/source/content/views/view_data_processor.cpp +++ b/plugins/builtin/source/content/views/view_data_processor.cpp @@ -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()); } }