Fix capture exception for metadata and core (#3335)

This commit is contained in:
Weiko
2024-01-09 17:46:16 +01:00
committed by GitHub
parent ebf7688e3d
commit 6c00aa92a4
9 changed files with 107 additions and 79 deletions

View File

@ -19,10 +19,14 @@ export class FieldMetadataResolver {
@Args('input') input: CreateOneFieldMetadataInput,
@AuthWorkspace() { id: workspaceId }: Workspace,
) {
return this.fieldMetadataService.createOne({
...input.field,
workspaceId,
});
try {
return this.fieldMetadataService.createOne({
...input.field,
workspaceId,
});
} catch (error) {
console.log(error);
}
}
@Mutation(() => FieldMetadataDTO)

View File

@ -56,7 +56,7 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
);
if (!objectMetadata) {
throw new NotFoundException('Object does not exist');
throw new Error('Object does not exist');
}
const fieldAlreadyExists = await this.fieldMetadataRepository.findOne({