Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

281
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda