How to get more detail from an exception?

Posted by cusimar9 on Stack Overflow See other posts from Stack Overflow or by cusimar9
Published on 2012-03-19T17:57:31Z Indexed on 2012/03/19 18:04 UTC
Read the original article Hit count: 252

I have a .NET 4.0 web application which implements an error handler within the Application_Error event of Global.asax.

When an exception occurs this intercepts it and sends me an email including a variety of information like the logged in user, the page the error occurred on, the contents of the session etc.

This is all great but there is some fundamental detail missing which I seem unable to locate.

For instance, this is a subset of an error I would receive and the associated stack trace:

Source: Telerik.Web.UI

Message: Selection out of range

Parameter name: value

Stack trace:    at Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource)
   at Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e)
   at Telerik.Web.UI.RadComboBox.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at Telerik.Web.UI.RadComboBox.DataBind()
   at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
   at Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Now as lovely as this is I could do with knowing a) the name of the control and b) the value which caused the control to be 'out of range'.

Any suggestions about how I could get this sort of information? I've run this in debug mode and the objects passed to Global.asax don't seem to hold any more detail that I can see.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about .NET