File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/nuxt/src/runtime/plugins Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11import { GLOBAL_OBJ , getClient } from '@sentry/core' ;
22import { browserTracingIntegration , vueIntegration } from '@sentry/vue' ;
3- import { defineNuxtPlugin } from 'nuxt/app' ;
3+ import { defineNuxtPlugin , isNuxtError } from 'nuxt/app' ;
44import type { GlobalObjWithIntegrationOptions } from '../../client/vueIntegration' ;
55import { reportNuxtError } from '../utils' ;
66
@@ -66,6 +66,13 @@ export default defineNuxtPlugin({
6666 } ) ;
6767
6868 nuxtApp . hook ( 'app:error' , error => {
69+ // Do not handle 404 and 422
70+ if ( isNuxtError ( error ) ) {
71+ // Do not report if status code is 3xx or 4xx
72+ if ( error . statusCode >= 300 && error . statusCode < 500 ) {
73+ return ;
74+ }
75+ }
6976 reportNuxtError ( { error } ) ;
7077 } ) ;
7178
You can’t perform that action at this time.
0 commit comments