Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Unassigned: Designer: reduce first chance exceptions [1182]

$
0
0
This is more of a suggestion than a bug report. While doing some stress testing I came across two points of code that were generating many first-chance exceptions that were later caught and handled, but that seemed to be unnecessary. Avoiding unnecessary first-chance exceptions allows for easier debugging of the product.

1. ModelToExplorerModelXRef.GetModelToBrowserModelXRef(): this method calls context.GetEFArtifactService() and expects the object to return an instance on which it calls the Artifact property getter. The code that calls this method seems to be ready for handling both exceptions and null returns. I suggest to check whether context.GetEFArtifactService() is null, and if so return null.

2. SearchComboBox.TrySetCaretBrush(): this method will only succeed if the Template property has a value and it contains the editable text box. We are wrapping the call to Template.FindName() into a catch block that ignores the exception thrown. I think most of the exceptions occurring here are due to the Template not being set when calling FindName(). I suggest to still have the try-catch block, but also checking whether Template is null before attempting to call Template.FindName().

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>