Made connection errors more user-friendly (#57)

This commit is contained in:
Mitchell Sternke
2016-09-21 11:59:03 -07:00
committed by GitHub
parent 159362f01b
commit 803a19d716
2 changed files with 20 additions and 2 deletions

View File

@@ -162,8 +162,16 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
connectionInfo.SqlConnection = connectionInfo.Factory.CreateSqlConnection(connectionString);
connectionInfo.SqlConnection.Open();
}
catch(Exception ex)
catch (SqlException ex)
{
response.ErrorNumber = ex.Number;
response.ErrorMessage = ex.Message;
response.Messages = ex.ToString();
return response;
}
catch (Exception ex)
{
response.ErrorMessage = ex.Message;
response.Messages = ex.ToString();
return response;
}