Skip to content

Commit c02d0d7

Browse files
committed
feat: show specific error message in toast when push subscription fails
1 parent 14929eb commit c02d0d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

components/design-events-calendar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ export default function DesignEventsCalendar() {
310310
} else {
311311
throw new Error("Failed to subscribe")
312312
}
313-
} catch (error) {
313+
} catch (error: any) {
314314
console.error(error)
315-
toast({ title: "Error", description: "Could not enable push notifications.", variant: "destructive" })
315+
toast({ title: "Error", description: error.message || "Could not enable push notifications.", variant: "destructive" })
316316
} finally {
317317
setIsPushSubscribing(false)
318318
}

0 commit comments

Comments
 (0)