Saturday, 14 September 2013

How to handle exceptions thrown in own ASP.NET user control?

How to handle exceptions thrown in own ASP.NET user control?

I have created a user control that is using a library I have created. The
library can throw a few exceptions, some which are of the kind that should
not cause a run-time issue. I am unsure how to best proceed from this
point in terms of handing those specific exceptions.
Do I include a label in my user control that will show a friendly message
when the exceptions mentioned above are thrown?
Do I avoid catching the exceptions and let the user of the control decide
what to do with them? Seems like this option would reveal information
about the workings of the control.
Do I create my own exception(s) and throw those when catching any of the
above mentioned exceptions?
Something else I have not thought about?

No comments:

Post a Comment