Show exception details during development in DotNetNuke

In DotNetNuke development when exceptions occured, the only short exception message is shown in the web page.
To see full details, you need to open log page, which is required a few mouse click and round-trips.

I found that for development (in Debug mode) it is more convinient to see full exceptions on the page.

The changes can be done in core DotNetNuke\Library\Components\Shared\PageBase.vb file, function Page_Error,

I've replaced strURL += IIf(strURL.IndexOf("?") = -1, "?", "&").ToString & "error=" & Server.UrlEncode(exc.Message)

to the code

Dim sErrMsg As String = exc.Message
#
If DEBUG Then
               
sErrMsg = exc.ToString
               
sErrMsg = Left(sErrMsg, 1800) 'limit the length to be less then GET limit 2048 http://support.microsoft.com/default.aspx?scid=KB;en-us;q208427

#End If

While sErrMsg.IndexOf("..") >= 0 '17/4/2006 added

sErrMsg = sErrMsg.Replace("..", ".") 'UrlRewriteModule do not except “..” for security reasons

End While
strURL += IIf(strURL.IndexOf("?") = -1, "?", "&").ToString & "error=" & Server.UrlEncode(sErrMsg)

Alternatively DEBUG  condition can be changed to check if it is Administrator running.

I've posted this as a  suggestion to dotnetnuke support.  

posted @ Monday, January 16, 2006 11:33 AM
Print

Comments on this entry:

# Exception handling in DotNetNuke Container for debugging

Left by Michael Freidgeim at 1/17/2006 2:19 PM
Gravatar
I've posted another tip for debugging exceptions

Your comment:



(not displayed)

 
 
 
 

Live Comment Preview:

 
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910