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

    Domanda

  • 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

    venerdì 10 settembre 2010 16:34

Risposte

Tutte le risposte

  • 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
    lunedì 13 settembre 2010 03:42
    Moderatore
  • 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>

    lunedì 13 settembre 2010 18:01
  • 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
    martedì 14 settembre 2010 02:21
    Moderatore
  • Thanks Nick,

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

    mercoledì 15 settembre 2010 15:50