don't throw, but log OTA listener errors (#958)

zio/stable
Ansh 2023-07-03 16:17:28 -07:00 committed by GitHub
parent 269c0687fd
commit 40a872612f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -42,7 +42,10 @@ export function useOTAUpdate() {
(event: Updates.UpdateEvent) => {
store.log.debug('useOTAUpdate: Listening for update...')
if (event.type === Updates.UpdateEventType.ERROR) {
throw new Error(event.message)
store.log.error(
'useOTAUpdate: Error while listening for update',
event.message,
)
} else if (event.type === Updates.UpdateEventType.NO_UPDATE_AVAILABLE) {
// Handle no update available
// do nothing