From 60d50b7382c4ceb1b967d46b326ae2d8022bf000 Mon Sep 17 00:00:00 2001 From: Bianca Wentzel Date: Mon, 16 Dec 2024 15:43:47 +0100 Subject: [PATCH] Exchanged console-error-statements with proper error handling --- assets/js/Containers/FrevaGPT/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/Containers/FrevaGPT/index.js b/assets/js/Containers/FrevaGPT/index.js index 74384789..952003e7 100644 --- a/assets/js/Containers/FrevaGPT/index.js +++ b/assets/js/Containers/FrevaGPT/index.js @@ -84,7 +84,7 @@ class FrevaGPT extends React.Component { pingSuccessful = true; } } catch (err) { - console.error("PingError: ", err); + pingSuccessful = false; } return pingSuccessful; @@ -259,7 +259,9 @@ class FrevaGPT extends React.Component { !subBuffer.includes("ServerHint") && !subBuffer.includes("Code") ) { - console.error(err); + this.props.dispatch( + addElement({ variant: "FrontendError", content: "Incomplete message received." }) + ); } } }