Fix custom exceptions not propagating error code (#10210)

## Context
In some CustomException exceptions, we were instantiating a code without
initializing it which was overriding the parent code and it was then
lost when retrieving it in filters.
Removing them to make sure we don't reproduce this pattern
This commit is contained in:
Weiko
2025-02-14 10:27:47 +01:00
committed by GitHub
parent ea07692abb
commit 934a97df51
32 changed files with 0 additions and 34 deletions
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class GraphqlQueryRunnerException extends CustomException {
code: GraphqlQueryRunnerExceptionCode;
constructor(message: string, code: GraphqlQueryRunnerExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkspaceQueryRunnerException extends CustomException {
code: WorkspaceQueryRunnerExceptionCode;
constructor(message: string, code: WorkspaceQueryRunnerExceptionCode) {
super(message, code);
}
@@ -3,7 +3,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class BillingException extends CustomException {
code: BillingExceptionCode;
constructor(message: string, code: BillingExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class FeatureFlagException extends CustomException {
code: FeatureFlagExceptionCode;
constructor(message: string, code: FeatureFlagExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class FileStorageException extends CustomException {
code: FileStorageExceptionCode;
constructor(message: string, code: FileStorageExceptionCode) {
super(message, code);
}
@@ -7,7 +7,6 @@ export enum FileExceptionCode {
}
export class FileException extends CustomException {
code: FileExceptionCode;
constructor(message: string, code: FileExceptionCode) {
super(message, code);
}
@@ -3,7 +3,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class SSOException extends CustomException {
code: SSOExceptionCode;
constructor(message: string, code: SSOExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class ThrottlerException extends CustomException {
code: ThrottlerExceptionCode;
constructor(message: string, code: ThrottlerExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class FieldMetadataException extends CustomException {
code: FieldMetadataExceptionCode;
constructor(message: string, code: FieldMetadataExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class ObjectMetadataException extends CustomException {
code: ObjectMetadataExceptionCode;
constructor(message: string, code: ObjectMetadataExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class PermissionsException extends CustomException {
code: PermissionsExceptionCode;
constructor(message: string, code: PermissionsExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class RelationMetadataException extends CustomException {
code: RelationMetadataExceptionCode;
constructor(message: string, code: RelationMetadataExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class RemoteServerException extends CustomException {
code: RemoteServerExceptionCode;
constructor(message: string, code: RemoteServerExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class DistantTableException extends CustomException {
code: DistantTableExceptionCode;
constructor(message: string, code: DistantTableExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class ForeignTableException extends CustomException {
code: ForeignTableExceptionCode;
constructor(message: string, code: ForeignTableExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class RemoteTableException extends CustomException {
code: RemoteTableExceptionCode;
constructor(message: string, code: RemoteTableExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class ServerlessFunctionException extends CustomException {
code: ServerlessFunctionExceptionCode;
constructor(message: string, code: ServerlessFunctionExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkspaceMetadataCacheException extends CustomException {
code: WorkspaceMetadataCacheExceptionCode;
constructor(message: string, code: WorkspaceMetadataCacheExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkspaceMetadataVersionException extends CustomException {
code: WorkspaceMetadataVersionExceptionCode;
constructor(message: string, code: WorkspaceMetadataVersionExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkspaceMigrationException extends CustomException {
code: WorkspaceMigrationExceptionCode;
constructor(message: string, code: WorkspaceMigrationExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class TwentyORMException extends CustomException {
code: TwentyORMExceptionCode;
constructor(message: string, code: TwentyORMExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkspaceCleanerException extends CustomException {
code: WorkspaceCleanerExceptionCode;
constructor(message: string, code: WorkspaceCleanerExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class CalendarEventImportDriverException extends CustomException {
code: CalendarEventImportDriverExceptionCode;
constructor(message: string, code: CalendarEventImportDriverExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class CalendarEventImportException extends CustomException {
code: CalendarEventImportExceptionCode;
constructor(message: string, code: CalendarEventImportExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class RefreshAccessTokenException extends CustomException {
code: RefreshAccessTokenExceptionCode;
constructor(message: string, code: RefreshAccessTokenExceptionCode) {
super(message, code);
}
@@ -1,11 +1,8 @@
import { CustomException } from 'src/utils/custom-exception';
export class MessageImportDriverException extends CustomException {
code: MessageImportDriverExceptionCode;
constructor(message: string, code: MessageImportDriverExceptionCode) {
super(message, code);
this.code = code;
}
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class MessageImportException extends CustomException {
code: MessageImportExceptionCode;
constructor(message: string, code: MessageImportExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkflowStepExecutorException extends CustomException {
code: WorkflowStepExecutorExceptionCode;
constructor(message: string, code: WorkflowStepExecutorExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class SendEmailActionException extends CustomException {
code: SendEmailActionExceptionCode;
constructor(message: string, code: SendEmailActionExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class RecordCRUDActionException extends CustomException {
code: RecordCRUDActionExceptionCode;
constructor(message: string, code: RecordCRUDActionExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkflowRunException extends CustomException {
code: WorkflowRunExceptionCode;
constructor(message: string, code: WorkflowRunExceptionCode) {
super(message, code);
}
@@ -1,7 +1,6 @@
import { CustomException } from 'src/utils/custom-exception';
export class WorkflowTriggerException extends CustomException {
code: WorkflowTriggerExceptionCode;
constructor(message: string, code: WorkflowTriggerExceptionCode) {
super(message, code);
}