error handling on update check

This commit is contained in:
FTCHD
2025-02-03 17:38:32 +02:00
parent aa1b97dfe7
commit 7e09c9e6d9
+8 -1
View File
@@ -168,7 +168,14 @@ function GeneralSection() {
console.log('checking for updates')
setIsWorkingUpdate(true)
setUpdateButtonText('Checking...')
const receivedUpdate = await check()
let receivedUpdate: Update | null = null
try {
receivedUpdate = await check()
} catch (e) {
console.error(e)
setUpdateButtonText('Failed to check')
return
}
console.log('receivedUpdate', JSON.stringify(receivedUpdate, null, 2))
if (!receivedUpdate) {
setUpdateButtonText('Up to date')