Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display ASP error in browser, NOT http 500 error

Status
Not open for further replies.

XgrinderX

Programmer
Joined
Mar 27, 2001
Messages
225
Location
US
Isn't there a setting in IIS that will allow it to display the actual ASP error message to the browser instead of just giving the HTTP 500 Page cannot be displayed error?

We have an old IIS server that does this, but the new one we set up just gives the HTTP 500 error and this makes it hard for debugging. We want to see the error message.

Any ideas?

-Greg
 
Here's the instructions. (Straight from a question I answered awhile ago.. this page gives u more than just the usual "useless" error page.. u'll understand when u put it in). :-)

Copy & paste this into a new file..
-----------------------------------------------
<%@ Language = VBSCRIPT %>
<% Option Explicit %>

<HTML>
<BODY>
<P>An Error has occurred. We appologize for this inconvenience.
<P>
<U>Useful Links:</U><BR>
<LI><A HREF=&quot;/&quot;>Main Page</A>

<P><HR><P>

<%
'Create an instance of the ASPError object
Dim objASPError
Set objASPError = Server.GetLastError()
%>

<CENTER>
<TABLE BORDER=1 CELLSPACING=1>
<TR>
<TH COLSPAN=2>Detailed Error Information</TH>
</TR>

<TR>
<TD>ASP Code</TD>
<TD><%=objASPError.ASPCode%></TD>
</TR>
<TR>
<TD>Error Number</TD>
<TD><%=objASPError.Number%></TD>
</TR>
<TR>
<TD>Source Code that caused the error</TD>
<TD><%=objASPError.Source%></TD>
</TR>
<TR>
<TD>Category</TD>
<TD><%=objASPError.Category%></TD>
</TR>
<TR>
<TD>Error Occured in</TD>
<TD><%=objASPError.File%></TD>
</TR>
<TR>
<TD>Line Number</TD>
<TD><%=objASPError.Line%></TD>
</TR>
<TR>
<TD>Column Number</TD>
<TD><%=objASPError.Column%></TD>
</TR>
<TR>
<TD>Description</TD>
<TD><%=objASPError.Description%></TD>
</TR>
<TR>
<TD>Extended Description</TD>
<TD><%=objASPError.ASPDescription%></TD>
</TR>
</TABLE>
</BODY>
</HTML>
-----------------------------------------------
Name the file ErrorHandler.asp then go into IIS.. right click on the website.. click properties.. under the &quot;custom errors&quot; tab.. find &quot;500:100 internal server error&quot; double click on it.. and replace the page in the &quot;URL&quot; box with new &quot;ErrorHandler.asp&quot; page.

Good Luck.

Hope this helps.

Terence Luk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top