From 8f2232575d337b9f7bf201054fffeea34623e869 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 22 Jun 2024 17:57:46 -0300 Subject: [PATCH] refactor: Handle error updating Component code in GenericNode When updating the Component code in GenericNode, handle any errors that occur. If an error occurs, display an error message with instructions to report the issue on Discord or GitHub. This improves the error handling and user experience when updating the Component code. --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 922c33dc6..9a1aaf7f2 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -239,6 +239,14 @@ export default function GenericNode({ } }) .catch((err) => { + setErrorData({ + title: "Error updating Compoenent code", + list: [ + "There was an error updating the Component.", + "If the error persists, please report it on our Discord or GitHub.", + ], + }); + setLoadingUpdate(false); console.log(err); }); }