From 30696e06c78c0fcc8500cc4ec6745177d45d19ea Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Wed, 20 Nov 2024 22:46:20 -0300 Subject: [PATCH 1/3] error-handling: Catch situation where Cockpit couldn't reach BlueOS It was one of the most common unhandled errors in Sentry's diagnose. --- src/stores/mainVehicle.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/stores/mainVehicle.ts b/src/stores/mainVehicle.ts index cf84fbd22..3486866bc 100644 --- a/src/stores/mainVehicle.ts +++ b/src/stores/mainVehicle.ts @@ -450,9 +450,15 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => { updateVehicleId() setInterval(async () => { - const blueosStatus = await getStatus(globalAddress.value) - // If blueos is not available, do not try to get data from it - if (!blueosStatus) return + try { + const blueosStatus = await getStatus(globalAddress.value) + if (!blueosStatus) { + throw new Error('BlueOS is not available.') + } + } catch (error) { + console.error(error) + return + } const blueosVariablesAddresses = { cpuTemp: 'blueos/cpu/tempC', From 8cde5dc6ce9728c4a654e00ba253951b9f5f0053 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Wed, 20 Nov 2024 22:58:21 -0300 Subject: [PATCH 2/3] error-handling: Catch situations where an unknown mini-widget type is trying to be loaded This is quite common to happen when the user is using an older version of the application, that does not have a latter introduced mini-widget, or when a developer is adding a new mini-widget to the application, and switches to branches that do not contain it yet. --- src/components/MiniWidgetInstantiator.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/MiniWidgetInstantiator.vue b/src/components/MiniWidgetInstantiator.vue index 0b57d8274..be0f0c2b7 100644 --- a/src/components/MiniWidgetInstantiator.vue +++ b/src/components/MiniWidgetInstantiator.vue @@ -5,7 +5,7 @@