Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling #1465

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
error-handling: Catch situation where Cockpit couldn't reach BlueOS
It was one of the most common unhandled errors in Sentry's diagnose.
rafaellehmkuhl committed Nov 25, 2024
commit 30696e06c78c0fcc8500cc4ec6745177d45d19ea
12 changes: 9 additions & 3 deletions src/stores/mainVehicle.ts
Original file line number Diff line number Diff line change
@@ -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',