mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-29 17:24:34 -05:00
Filtering Schema Compare error from warnings (#1212)
* Filtering Schema Compare error from warnings * SchemaCompare added comparison result error message validations to existing tests * Extra semi-colon noticed and removed from the code * Added new test case to validate warning message exclusions from SC result * SC test asserions comment added * Edge case scenario fixed and tests are 100% passed
This commit is contained in:
committed by
GitHub
parent
64a6b6a85c
commit
37b2b26edf
@@ -120,9 +120,13 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
|
||||
}
|
||||
}
|
||||
|
||||
// Appending the set of errors that are stopping the schema compare to the ErrorMessage
|
||||
var errorsList = ComparisonResult.GetErrors().Select(e => e.Message).Distinct().ToList();
|
||||
ErrorMessage = string.Join("\n", errorsList);
|
||||
// Appending the set of errors that are stopping the schema compare to the ErrorMessage
|
||||
// GetErrors return all type of warnings, and error messages. Only filtering the error type messages here
|
||||
var errorsList = ComparisonResult.GetErrors().Where(x => x.MessageType.Equals(Microsoft.SqlServer.Dac.DacMessageType.Error)).Select(e => e.Message).Distinct().ToList();
|
||||
if (errorsList.Count > 0)
|
||||
{
|
||||
ErrorMessage = string.Join("\n", errorsList);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user