Use return await to catch exceptions (#6109)

So the exceptions are handled properly and filtered in sentry
This commit is contained in:
Thomas Trompette
2024-07-03 11:14:28 +02:00
committed by GitHub
parent 5b26452649
commit 4183e5460d
5 changed files with 38 additions and 20 deletions

View File

@ -23,12 +23,15 @@ export class ObjectMetadataResolver {
) {}
@Mutation(() => ObjectMetadataDTO)
deleteOneObject(
async deleteOneObject(
@Args('input') input: DeleteOneObjectInput,
@AuthWorkspace() { id: workspaceId }: Workspace,
) {
try {
return this.objectMetadataService.deleteOneObject(input, workspaceId);
return await this.objectMetadataService.deleteOneObject(
input,
workspaceId,
);
} catch (error) {
objectMetadataGraphqlApiExceptionHandler(error);
}
@ -42,7 +45,10 @@ export class ObjectMetadataResolver {
try {
await this.beforeUpdateOneObject.run(input, workspaceId);
return this.objectMetadataService.updateOneObject(input, workspaceId);
return await this.objectMetadataService.updateOneObject(
input,
workspaceId,
);
} catch (error) {
objectMetadataGraphqlApiExceptionHandler(error);
}