@@ -101,7 +101,12 @@ class SentryGlobalFilter extends BaseExceptionFilter {
101
101
this . _logger . error ( exception . message , exception . stack ) ;
102
102
}
103
103
104
- captureException ( exception ) ;
104
+ captureException ( exception , {
105
+ mechanism : {
106
+ handled : false ,
107
+ type : 'nestjs.graphql' ,
108
+ } ,
109
+ } ) ;
105
110
throw exception ;
106
111
}
107
112
@@ -117,15 +122,25 @@ class SentryGlobalFilter extends BaseExceptionFilter {
117
122
// Handle any other kind of error
118
123
if ( ! ( exception instanceof Error ) ) {
119
124
if ( ! isExpectedError ( exception ) ) {
120
- captureException ( exception ) ;
125
+ captureException ( exception , {
126
+ mechanism : {
127
+ handled : false ,
128
+ type : 'nestjs.rpc' ,
129
+ } ,
130
+ } ) ;
121
131
}
122
132
throw exception ;
123
133
}
124
134
125
135
// In this case we're likely running into an RpcException, which the user should handle with a dedicated filter
126
136
// https://github.com/nestjs/nest/blob/master/sample/03-microservices/src/common/filters/rpc-exception.filter.ts
127
137
if ( ! isExpectedError ( exception ) ) {
128
- captureException ( exception ) ;
138
+ captureException ( exception , {
139
+ mechanism : {
140
+ handled : false ,
141
+ type : 'nestjs.rpc-exception' ,
142
+ } ,
143
+ } ) ;
129
144
}
130
145
131
146
this . _logger . warn (
@@ -139,7 +154,12 @@ class SentryGlobalFilter extends BaseExceptionFilter {
139
154
140
155
// HTTP exceptions
141
156
if ( ! isExpectedError ( exception ) ) {
142
- captureException ( exception ) ;
157
+ captureException ( exception , {
158
+ mechanism : {
159
+ handled : false ,
160
+ type : 'nestjs.http' ,
161
+ } ,
162
+ } ) ;
143
163
}
144
164
145
165
return super . catch ( exception , host ) ;
0 commit comments