Fix/restore connection issue (#416)

* fixed the connection issue used for restore

* fixed a test
This commit is contained in:
Leila Lali
2017-07-17 15:57:30 -07:00
committed by GitHub
parent 836847ce15
commit d5b2bcdcb7
3 changed files with 34 additions and 6 deletions

View File

@@ -123,9 +123,10 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
RestoreParams restoreParams,
RequestContext<RestorePlanResponse> requestContext)
{
RestorePlanResponse response = new RestorePlanResponse();
try
{
RestorePlanResponse response = new RestorePlanResponse();
ConnectionInfo connInfo;
bool supported = IsBackupRestoreOperationSupported(restoreParams, out connInfo);
@@ -143,7 +144,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
}
catch (Exception ex)
{
await requestContext.SendError(ex.ToString());
response.CanRestore = false;
response.ErrorMessage = ex.Message;
await requestContext.SendResult(response);
}
}
@@ -154,9 +157,10 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
RestoreParams restoreParams,
RequestContext<RestoreResponse> requestContext)
{
RestoreResponse response = new RestoreResponse();
try
{
RestoreResponse response = new RestoreResponse();
ConnectionInfo connInfo;
bool supported = IsBackupRestoreOperationSupported(restoreParams, out connInfo);
@@ -199,7 +203,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
}
catch (Exception ex)
{
await requestContext.SendError(ex.ToString());
response.Result = false;
response.ErrorMessage = ex.Message;
await requestContext.SendResult(response);
}
}