Reduce presentation data in validation errors

- Add ValidationError type to hold validation results
- Change validation to return lists of ValidationErrors
This commit is contained in:
John Lewin 2019-01-04 17:09:42 -08:00
parent 83fcf4f128
commit 063db01796
12 changed files with 265 additions and 76 deletions

View file

@ -2254,7 +2254,12 @@ namespace MatterHackers.MatterControl
var errors = SettingsValidation.SettingsValid(printer);
if(errors.Count > 0)
{
StyledMessageBox.ShowMessageBox(String.Join("\n__________________\n\n", errors.ToArray()), "Slice Error".Localize());
// Project to newline separated Error/Details string
var formattedErrors = errors.Select(err => $"{err.Error}\n\n{err.Details}").ToArray();
StyledMessageBox.ShowMessageBox(
string.Join("\n__________________\n\n", formattedErrors),
"Export Error".Localize());
}
else // there are no erros continue printing
{