Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development

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
sErrMsg = exc.ToString
sErrMsg = Left(sErrMsg, 1800) 'limit the length to be less then GET limit 2048;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 on Monday, January 16, 2006 11:33 AM DotNetNuke | Back to top

Comments on this post: Show exception details during development in DotNetNuke

# Exception handling in DotNetNuke Container for debugging
Requesting Gravatar...
I've posted another tip for debugging exceptions
Left by Michael Freidgeim on Jan 17, 2006 2:19 PM

Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: | Join free