feat(domain-manager): refactor custom domain validation and improve c… (#13388)
This commit is contained in:
+10
-10
@@ -1,12 +1,12 @@
|
||||
import { CustomException } from 'src/utils/custom-exception';
|
||||
import {
|
||||
appendCommonExceptionCode,
|
||||
CustomException,
|
||||
} from 'src/utils/custom-exception';
|
||||
|
||||
export class DistantTableException extends CustomException {
|
||||
constructor(message: string, code: DistantTableExceptionCode) {
|
||||
super(message, code);
|
||||
}
|
||||
}
|
||||
export class DistantTableException extends CustomException<
|
||||
keyof typeof DistantTableExceptionCode
|
||||
> {}
|
||||
|
||||
export enum DistantTableExceptionCode {
|
||||
INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR',
|
||||
TIMEOUT_ERROR = 'TIMEOUT_ERROR',
|
||||
}
|
||||
export const DistantTableExceptionCode = appendCommonExceptionCode({
|
||||
TIMEOUT_ERROR: 'TIMEOUT_ERROR',
|
||||
} as const);
|
||||
|
||||
+1
-5
@@ -1,10 +1,6 @@
|
||||
import { CustomException } from 'src/utils/custom-exception';
|
||||
|
||||
export class ForeignTableException extends CustomException {
|
||||
constructor(message: string, code: ForeignTableExceptionCode) {
|
||||
super(message, code);
|
||||
}
|
||||
}
|
||||
export class ForeignTableException extends CustomException<ForeignTableExceptionCode> {}
|
||||
|
||||
export enum ForeignTableExceptionCode {
|
||||
FOREIGN_TABLE_MUTATION_NOT_ALLOWED = 'FOREIGN_TABLE_MUTATION_NOT_ALLOWED',
|
||||
|
||||
+1
-6
@@ -1,11 +1,6 @@
|
||||
import { CustomException } from 'src/utils/custom-exception';
|
||||
|
||||
export class RemoteTableException extends CustomException {
|
||||
declare code: RemoteTableExceptionCode;
|
||||
constructor(message: string, code: RemoteTableExceptionCode) {
|
||||
super(message, code);
|
||||
}
|
||||
}
|
||||
export class RemoteTableException extends CustomException<RemoteTableExceptionCode> {}
|
||||
|
||||
export enum RemoteTableExceptionCode {
|
||||
REMOTE_TABLE_NOT_FOUND = 'REMOTE_TABLE_NOT_FOUND',
|
||||
|
||||
Reference in New Issue
Block a user