locked
How do you read the Error object when 500 error is triggered? RRS feed

  • Question

  • Here is the problem:

    A user encounters a 500 error and is routed to the page identified by the web server so that the error can be processed.  But when you process the error from that page the Err object is empty.  There is no Err.number or Err.description.  It appears to have been cleared when the new page is loaded.

    Does anyone have a solution to this problem?

    Thanks

    Mike

    Friday, September 10, 2010 4:34 PM

Answers

All replies

  • Hi,

     

    Thank you for the post.

     

    According to the description, this issue is not related to ISA.  If you want to customize error messages, you may refer to: http://technet.microsoft.com/en-us/library/bb794832.aspx

     

    Regards,


    Nick Gu - MSFT
    Monday, September 13, 2010 3:42 AM
    Moderator
  • Nick,

    Thanks for the response.  I do trap the error with a customized program. 

    I've configured IIS7 "Error Pages" to execute a custom program called error_500.asp whenever a 500 error is encountered.  The program works quite well and is a combination of HTML and ASP code.  My problem is that I cannot capture the error object that triggered the 500 error.

    Here is the code for the custom page.  Notice that the <%=Err.description%> is always blank.  However... if I install the code on the page that actually generated the error I get a description of the error.  It seems that when the custom page is loaded the error object is cleared. 

    Is there any way to read the error?

    <html>
    <head>
    <title>FTI Global</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="http://ftiglobal.com/fti/css/main.css" rel="stylesheet" type="text/css">

    </head>
    <body  bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="http://ftiglobal.com/fti/images/logo_new.gif" width="331" height="111">    </td>
      </tr>
    </table>
    <table width="837" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="837" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="5%">&nbsp;</td>
            <td width="93%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td class="arial_blue_14_bold">Page Opening Error </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td class="content_area">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td class="content_area">We are sorry for any inconvenience. The page you attempted to open had an error and was forwarded to support for investigation. </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>

          <tr>
            <td>&nbsp;</td>
            <td class="content_area">Error Description: <%=Err.description%> </td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
          </td>
      </tr>
    </table>
    </body>
    </html>

    Monday, September 13, 2010 6:01 PM
  • Hi,

     

    Thank you for the update.

     

    As far as I know, when customize the error message in ISA, the file extension is .htm.  For the IIS issue, you may post to IIS forum : http://forums.iis.net/1041.aspx

     

    Regards,


    Nick Gu - MSFT
    Tuesday, September 14, 2010 2:21 AM
    Moderator
  • Thanks Nick,

    The ASP page works quite well for a customized page.  I'll post in the other forum.  Thanks again.

    Wednesday, September 15, 2010 3:50 PM