Skip to content

Commit

Permalink
feat: show toast with global errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Nov 13, 2023
1 parent c555108 commit cae4309
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup>
import { toast } from 'vue-sonner'
useAppStatistics()
const { toggle: toggleMenu } = useMenu()
Expand All @@ -12,7 +14,11 @@
toggleSearchMenu(false)
})
// TODO: Log general errors to the user with a Toast
// Show error toast on uncaught errors
// TODO: Verify it works
onErrorCaptured((error) => {
toast.error(error.message)
})
console.info(
'%cWe ❤︎ open source!',
Expand Down

0 comments on commit cae4309

Please sign in to comment.