diff --git a/public/index.html b/public/index.html
index adc005a..6922209 100644
--- a/public/index.html
+++ b/public/index.html
@@ -2458,8 +2458,9 @@
ws = new WebSocket(`${protocol}//${window.location.host}`);
ws.onmessage = (event) => {
- const data = JSON.parse(event.data);
- console.log('WebSocket message:', data);
+ try {
+ const data = JSON.parse(event.data);
+ console.log('WebSocket message:', data);
// Handle specific message types
if (data.type === 'command_result') {
@@ -2521,9 +2522,13 @@
loadWorkflows();
}
- // Generic refresh for other message types
- if (!['command_result', 'workflow_result', 'worker_update', 'execution_started', 'execution_status', 'workflow_created', 'workflow_deleted'].includes(data.type)) {
- refreshData();
+ // Generic refresh for other message types
+ if (!['command_result', 'workflow_result', 'worker_update', 'execution_started', 'execution_status', 'workflow_created', 'workflow_deleted'].includes(data.type)) {
+ refreshData();
+ }
+ } catch (error) {
+ console.error('Error handling WebSocket message:', error);
+ console.error('Stack trace:', error.stack);
}
};