Use return await to catch exceptions (#6109)
So the exceptions are handled properly and filtered in sentry
This commit is contained in:
@ -26,7 +26,10 @@ export class RemoteServerResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteServerService.createOneRemoteServer(input, workspaceId);
|
||||
return await this.remoteServerService.createOneRemoteServer(
|
||||
input,
|
||||
workspaceId,
|
||||
);
|
||||
} catch (error) {
|
||||
remoteServerGraphqlApiExceptionHandler(error);
|
||||
}
|
||||
@ -38,7 +41,10 @@ export class RemoteServerResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteServerService.updateOneRemoteServer(input, workspaceId);
|
||||
return await this.remoteServerService.updateOneRemoteServer(
|
||||
input,
|
||||
workspaceId,
|
||||
);
|
||||
} catch (error) {
|
||||
remoteServerGraphqlApiExceptionHandler(error);
|
||||
}
|
||||
@ -50,7 +56,10 @@ export class RemoteServerResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteServerService.deleteOneRemoteServer(id, workspaceId);
|
||||
return await this.remoteServerService.deleteOneRemoteServer(
|
||||
id,
|
||||
workspaceId,
|
||||
);
|
||||
} catch (error) {
|
||||
remoteServerGraphqlApiExceptionHandler(error);
|
||||
}
|
||||
@ -62,7 +71,7 @@ export class RemoteServerResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteServerService.findOneByIdWithinWorkspace(
|
||||
return await this.remoteServerService.findOneByIdWithinWorkspace(
|
||||
id,
|
||||
workspaceId,
|
||||
);
|
||||
@ -78,7 +87,7 @@ export class RemoteServerResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteServerService.findManyByTypeWithinWorkspace(
|
||||
return await this.remoteServerService.findManyByTypeWithinWorkspace(
|
||||
foreignDataWrapperType,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
@ -21,7 +21,7 @@ export class RemoteTableResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteTableService.findDistantTablesWithStatus(
|
||||
return await this.remoteTableService.findDistantTablesWithStatus(
|
||||
input.id,
|
||||
workspaceId,
|
||||
input.shouldFetchPendingSchemaUpdates,
|
||||
@ -37,7 +37,7 @@ export class RemoteTableResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteTableService.syncRemoteTable(input, workspaceId);
|
||||
return await this.remoteTableService.syncRemoteTable(input, workspaceId);
|
||||
} catch (error) {
|
||||
remoteTableGraphqlApiExceptionHandler(error);
|
||||
}
|
||||
@ -49,7 +49,10 @@ export class RemoteTableResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteTableService.unsyncRemoteTable(input, workspaceId);
|
||||
return await this.remoteTableService.unsyncRemoteTable(
|
||||
input,
|
||||
workspaceId,
|
||||
);
|
||||
} catch (error) {
|
||||
remoteTableGraphqlApiExceptionHandler(error);
|
||||
}
|
||||
@ -61,7 +64,7 @@ export class RemoteTableResolver {
|
||||
@AuthWorkspace() { id: workspaceId }: Workspace,
|
||||
) {
|
||||
try {
|
||||
return this.remoteTableService.syncRemoteTableSchemaChanges(
|
||||
return await this.remoteTableService.syncRemoteTableSchemaChanges(
|
||||
input,
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user