@@ -101,7 +101,12 @@ class SentryGlobalFilter extends BaseExceptionFilter {
101101 this . _logger . error ( exception . message , exception . stack ) ;
102102 }
103103
104- captureException ( exception ) ;
104+ captureException ( exception , {
105+ mechanism : {
106+ handled : false ,
107+ type : 'nestjs.graphql' ,
108+ } ,
109+ } ) ;
105110 throw exception ;
106111 }
107112
@@ -117,15 +122,25 @@ class SentryGlobalFilter extends BaseExceptionFilter {
117122 // Handle any other kind of error
118123 if ( ! ( exception instanceof Error ) ) {
119124 if ( ! isExpectedError ( exception ) ) {
120- captureException ( exception ) ;
125+ captureException ( exception , {
126+ mechanism : {
127+ handled : false ,
128+ type : 'nestjs.rpc' ,
129+ } ,
130+ } ) ;
121131 }
122132 throw exception ;
123133 }
124134
125135 // In this case we're likely running into an RpcException, which the user should handle with a dedicated filter
126136 // https://github.com/nestjs/nest/blob/master/sample/03-microservices/src/common/filters/rpc-exception.filter.ts
127137 if ( ! isExpectedError ( exception ) ) {
128- captureException ( exception ) ;
138+ captureException ( exception , {
139+ mechanism : {
140+ handled : false ,
141+ type : 'nestjs.rpc-exception' ,
142+ } ,
143+ } ) ;
129144 }
130145
131146 this . _logger . warn (
@@ -139,7 +154,12 @@ class SentryGlobalFilter extends BaseExceptionFilter {
139154
140155 // HTTP exceptions
141156 if ( ! isExpectedError ( exception ) ) {
142- captureException ( exception ) ;
157+ captureException ( exception , {
158+ mechanism : {
159+ handled : false ,
160+ type : 'nestjs.http' ,
161+ } ,
162+ } ) ;
143163 }
144164
145165 return super . catch ( exception , host ) ;
0 commit comments