Improve sentry filtering and grouping (#12071)
Follow-up on https://github.com/twentyhq/twenty/pull/12007 In this PR - adding a filter on HttpExceptionHandlerService to filter out 4xx errors from driver handling (as we do for graphQL errors: see useGraphQLErrorHandler hook - only filteredIssues are sent to` exceptionHandlerService.captureExceptions()`.) - grouping together more missing metadata issues - attempting to use error codes as issues names in sentry to improve UI; for now it says "Error" all the time
This commit is contained in:
+5
-5
@@ -5,21 +5,21 @@ import {
|
||||
ModuleRef,
|
||||
createContextId,
|
||||
} from '@nestjs/core';
|
||||
import { Module } from '@nestjs/core/injector/module';
|
||||
import { Injector } from '@nestjs/core/injector/injector';
|
||||
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
|
||||
import { Module } from '@nestjs/core/injector/module';
|
||||
|
||||
import { MessageQueueWorkerOptions } from 'src/engine/core-modules/message-queue/interfaces/message-queue-worker-options.interface';
|
||||
import {
|
||||
MessageQueueJob,
|
||||
MessageQueueJobData,
|
||||
} from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
|
||||
import { MessageQueueWorkerOptions } from 'src/engine/core-modules/message-queue/interfaces/message-queue-worker-options.interface';
|
||||
|
||||
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
||||
import { MessageQueueMetadataAccessor } from 'src/engine/core-modules/message-queue/message-queue-metadata.accessor';
|
||||
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||
import { getQueueToken } from 'src/engine/core-modules/message-queue/utils/get-queue-token.util';
|
||||
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
||||
import { shouldFilterException } from 'src/engine/utils/global-exception-handler.util';
|
||||
import { shouldCaptureException } from 'src/engine/utils/global-exception-handler.util';
|
||||
|
||||
interface ProcessorGroup {
|
||||
instance: object;
|
||||
@@ -207,7 +207,7 @@ export class MessageQueueExplorer implements OnModuleInit {
|
||||
// @ts-expect-error legacy noImplicitAny
|
||||
await instance[processMethodName].call(instance, job.data);
|
||||
} catch (err) {
|
||||
if (!shouldFilterException(err)) {
|
||||
if (shouldCaptureException(err)) {
|
||||
this.exceptionHandlerService.captureExceptions([err]);
|
||||
}
|
||||
throw err;
|
||||
|
||||
Reference in New Issue
Block a user