feat(domain-manager): refactor custom domain validation and improve c… (#13388)
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
import { CustomException } from 'src/utils/custom-exception';
|
||||
|
||||
export class RelationException extends CustomException {
|
||||
declare code: RelationExceptionCode;
|
||||
constructor(message: string, code: RelationExceptionCode) {
|
||||
super(message, code);
|
||||
}
|
||||
}
|
||||
export class RelationException extends CustomException<RelationExceptionCode> {}
|
||||
|
||||
export enum RelationExceptionCode {
|
||||
RELATION_OBJECT_METADATA_NOT_FOUND = 'RELATION_OBJECT_METADATA_NOT_FOUND',
|
||||
RELATION_TARGET_FIELD_METADATA_ID_NOT_FOUND = 'RELATION_TARGET_FIELD_METADATA_ID_NOT_FOUND',
|
||||
RELATION_TARGET_FIELD_METADATA_NOT_FOUND = 'RELATION_TARGET_FIELD_METADATA_NOT_FOUND',
|
||||
INVALID_RELATION_TYPE = 'INVALID_RELATION_TYPE',
|
||||
RELATION_JOIN_COLUMN_ON_BOTH_SIDES = 'RELATION_JOIN_COLUMN_ON_BOTH_SIDES',
|
||||
MISSING_RELATION_JOIN_COLUMN = 'MISSING_RELATION_JOIN_COLUMN',
|
||||
MULTIPLE_JOIN_COLUMNS_FOUND = 'MULTIPLE_JOIN_COLUMNS_FOUND',
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
import { CustomException } from 'src/utils/custom-exception';
|
||||
|
||||
export class TwentyORMException extends CustomException {
|
||||
constructor(
|
||||
message: string,
|
||||
code: TwentyORMExceptionCode,
|
||||
{ userFriendlyMessage }: { userFriendlyMessage?: string } = {},
|
||||
) {
|
||||
super(message, code, userFriendlyMessage);
|
||||
}
|
||||
}
|
||||
export class TwentyORMException extends CustomException<TwentyORMExceptionCode> {}
|
||||
|
||||
export enum TwentyORMExceptionCode {
|
||||
METADATA_VERSION_MISMATCH = 'METADATA_VERSION_MISMATCH',
|
||||
|
||||
Reference in New Issue
Block a user