From dfc54f99cfa94eccf7b5de64e15ee6f3f7c688bc Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Tue, 21 Feb 2023 16:53:21 -0800 Subject: [PATCH] Fix error not getting sent back when generating deploy plan (#1875) --- .../DacFx/DacFxService.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/DacFx/DacFxService.cs b/src/Microsoft.SqlTools.ServiceLayer/DacFx/DacFxService.cs index 879539b3..05bdbe68 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/DacFx/DacFxService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/DacFx/DacFxService.cs @@ -187,16 +187,19 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx out connInfo); if (connInfo != null) { - GenerateDeployPlanOperation operation = new GenerateDeployPlanOperation(parameters, connInfo); - operation.Execute(parameters.TaskExecutionMode); - - await requestContext.SendResult(new GenerateDeployPlanRequestResult() + await BaseService.RunWithErrorHandling(async () => { - OperationId = operation.OperationId, - Success = true, - ErrorMessage = string.Empty, - Report = operation.DeployReport - }); + GenerateDeployPlanOperation operation = new GenerateDeployPlanOperation(parameters, connInfo); + operation.Execute(parameters.TaskExecutionMode); + + return new GenerateDeployPlanRequestResult() + { + OperationId = operation.OperationId, + Success = true, + ErrorMessage = string.Empty, + Report = operation.DeployReport + }; + }, requestContext); } }