Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

287
Vistas
Catch Error details on IIS Custom Error Page

Using web.config I configured IIS to redirect 500 errors to a custom page that is in my application.

<httpErrors errorMode="Custom">
        <remove statusCode="500" />
        <error statusCode="500" path="/Pages/ErrorPages/CustomError.asp" responseMode="ExecuteURL" />
    </httpErrors>

This is working perfectly and it is redirecting to the mentioned classic asp page when there is a 500 error.

Now I want to capture the error details such as file path and line number from my custom error page, which shows on the standard error page when we set "Send errors To Browser" to TRUE and Error page features to "Detailed errors"

What are the methods I can use to solve this by configuring IIS and using javascript/jquery

Send errors To Browser Error page features Sample standerd detailed error

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As the Detailed Error overrides the content of my custom error page, I came up with a different approach to overcome my problem.

I Enabled Failed Request Tracking Rule on IIS and it creates a log folder inside inetpub\logs\FailedReqLogFiles

enter image description here

Inside that folder, It creates a separate error log (XML) for each Error. That XML has a format like below.

<failedRequest url="" siteId="" appPoolId="" processId="" verb="GET" remoteUserName="" userName="" tokenUserName="NT AUTHORITY\IUSR" authenticationType="anonymous" activityId="" failureReason="STATUS_CODE" statusCode="500" triggerStatusCode="500" timeTaken="" xmlns:freb="">
<Event>
<System></System><EventData></EventData><RenderingInfo></RenderingInfo><ExtendedTracingInfo></ExtendedTracingInfo>
</Event>
<Event>
<System></System><EventData></EventData><RenderingInfo></RenderingInfo><ExtendedTracingInfo></ExtendedTracingInfo>
</Event>
...
...
</failedRequest

I looped through Event tags and Selected the one with Event>System>Level is equal to 2. That is the event it shows as an Error when you preview the XML. Then you can read Event>EventData for Error LineNumber and Description.

From my custom error page, I requested information using an XHR call and stored it in a hidden field until required.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda