• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / iznik-nuxt3 / 27a8f7c6-79b8-459f-a7fb-fae1f118baf7

24 Jul 2025 12:41PM UTC coverage: 48.85% (-0.08%) from 48.928%
27a8f7c6-79b8-459f-a7fb-fae1f118baf7

push

circleci

edwh
Try adding Playwright tests for Browse.

2212 of 5648 branches covered (39.16%)

Branch coverage included in aggregate %.

5219 of 9564 relevant lines covered (54.57%)

95.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

32.08
/plugins/something-went-wrong.client.js
1
import * as Sentry from '@sentry/browser'
2
import { APIError, MaintenanceError } from '@/api/BaseAPI'
3
import { useMiscStore } from '~/stores/misc'
4
import { useRouter } from '#imports'
5
import { suppressException } from '~/composables/useSuppressException'
6

7
export default defineNuxtPlugin((nuxtApp) => {
46✔
8
  const originalErrorHandler = nuxtApp.vueApp.config.errorHandler
94✔
9

10
  nuxtApp.vueApp.config.errorHandler = (err, vm, info, ...rest) => {
94✔
11
    console.log('Vue errorHandler', err.message)
14✔
12
    if (err instanceof MaintenanceError) {
14!
13
      // This is thrown in response to API return codes from the server.
14
      throw err
×
15
    } else if (err instanceof APIError && vm && vm.$bvToast) {
14!
16
      const { request, response } = err
×
17
      try {
×
18
        // We have seen Sentry issues which look as though our console.error log here is itself causing an exception,
19
        // on older devices which might be less good at using console on complex objects.
20
        //
21
        // So log more carefully.
22
        console.log('Vue errorHandler')
×
23
        console.log('Err', err)
×
24
        console.log('Request', request)
×
25
        console.error('Response', response)
×
26
      } catch (e) {
27
        console.error('Error in toast logging', e)
×
28
      }
29

30
      // Trigger popup.
31
      const miscStore = useMiscStore()
×
32
      miscStore.setErrorDetails(err)
×
33

34
      Sentry.captureMessage('API error')
×
35

36
      return true
×
37
    } else if (suppressException(err)) {
14!
38
      return true
×
39
    }
40

41
    if (originalErrorHandler) {
14!
42
      return originalErrorHandler(err, vm, info, ...rest)
14✔
43
    }
44
  }
45

46
  window.addEventListener('unhandledrejection', function (event) {
94✔
47
    const reason = event?.reason?.message
×
48

49
    if (reason?.includes('Maintenance error')) {
×
50
      // The API may throw this, and it may not get caught.
51
      const router = useRouter()
×
52
      router.push('/maintenance')
×
53
    } else if (reason) {
×
54
      // No point alerting the user if we have no info.
55
      const miscStore = useMiscStore()
×
56
      const error = new Error(reason)
×
57
      miscStore.setErrorDetails(error)
×
58
      Sentry.captureMessage('Unhandled promise', reason)
×
59
    }
60
  })
61
})
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc