Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Exception handling in CRM 2011 plugins

$
0
0

We are using a custom entity to handle logging of exceptions thrown by a plugin.  As I understand, if a plugin registered for stage 20 or 40 throws an exception,the entire transaction is rolled back,including attempts to create and persist any custom error log entity instances in the catch handler.The question is,is it a good practice to catch the exception, write to the log entity and not raise the exception further up the chain,in effect prevent the rollback and swallow the exception.My take is that this is not a good practice in general but would like to hear thoughts on this.If this is not recommended,is there a best practice for logging exceptions if the plugin is running in a transactional stage?

Thanks.


-Abhijeet




Viewing all articles
Browse latest Browse all 8223

Trending Articles



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