General warning swallower

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In my solution I'm opening a lot of families from within a project. Sometimes some popups appear during opening a family. I enclosed the opening process inside a transaction in which I handle warnings via IFailuresPreprocessor. I noticed that:
about 90% warnings I can suppres with the following:
FailuresAccessor a; a.DeleteAllWarnings(); return FailureProcessingResult.Continue;
But the remaining 10% won't get suppressed with such treatment, they do get suppressed with:
FailuresAccessor a; IList<FailureMessageAccessor> failures = a.GetFailureMessages(); a.ResolveFailures(failures); return FailureProcessingResult.ProceedWithCommit;
Is there a general way to check with what kind of treatment current warning can get suppressed? I don't want to go into a switch case block because the warnings are really various and it'd take ages before I covered them all. Another issue is that it doesn't matter so much how I treat the warnings because I don't resave the families in my solution - I just close them without saving.