2016-11-18 5 views
1

私は、エラーを処理するページを指すようにweb.configで設定したので、ページエラーが発生したときに私の古典的なASP Webサイトにコードを簡単に書き込むことができます。ASPエラーの原因を調べる

<httpErrors errorMode="Custom" defaultResponseMode="ExecuteURL"> 
    <remove statusCode="500" subStatusCode="100" /> 
    <remove statusCode="500" subStatusCode="-1" /> 
    <remove statusCode="404" subStatusCode="-1" /> 
    <error statusCode="404" path="/error_404.asp" responseMode="ExecuteURL" /> 
    <error statusCode="500" prefixLanguageFilePath="" path="/error_500.asp" responseMode="ExecuteURL" /> 
    <error statusCode="500" subStatusCode="100" path="/error_500.asp" responseMode="ExecuteURL" /> 
</httpErrors> 

これは、コードの私の単純なビットです:私は、一緒にこれらの値を連結し、自分自身に詳細をメール

... 
set objError =   Server.getLastError() 
strNumber =    objError.AspCode 
strSource =    objError.Category 
strDesc =    newstr(objError.Description) 
strCode =    newstr(objError.Source) 
strLine =    ObjError.Line 
strASPDesc =   ObjError.ASPDescription 
strRemoteAddr =   Request.ServerVariables("REMOTE_ADDR") 
ref =     request.servervariables("HTTP_REFERER") 
str =     request.servervariables("QUERY_STRING") 
cookies =    request.servervariables("HTTP_COOKIE") 
ip_url =    strRemoteAddr 
ua =     newstr(request.servervariables("HTTP_USER_AGENT")) 
totalstring =   objError.File & "?" & str 

。エラーのために

、私はこのような何かを得るだろう:しかし、私は多くの場合のみ、このエラーが表示さ

strNumber: ASP 0126 
strSource: Active Server Pages 
strDesc: Include file not found 
strCode: 
strLine: 14 
strASPDesc: The include file '/news/aw.asp' was not found. 
strRemoteAddr: 2.101.166.175 
ref: http://example.com/sites/support/ 
str: page=cd 
cookies: usr1=62105233D8E2A062A55; fantastic%5Fcheese=1; _ga=GA1.3.1357551757.1476543431; __atuvc=2%7C41%2C1%7C42%2C0%7C43%2C0%7C44%2C9%7C45; __utma=154830755.1357551757.1476543431.1476822981.1479368067.3; __utmz=154830755.1476818175.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ASPSESSIONIDQCBABQAR=KHGBAMBCCCENHCIPPCOFBJOO; __utmb=154830755.1.10.1479368067; __utmc=154830755; __utmt=1 
ip_url: 84.92.46.118 
ua: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 
totalstring: /sites/support/page.asp?landscape=cd 

を:

strNumber: 
strSource: 
strDesc: 
strCode: 
strLine: 0 
strASPDesc: 
strRemoteAddr: 43.247.156.6 
ref: http:/example.com/content/this.asp 
str: 500;http://jimpix.co.uk:80/words/check-username.asp 
cookies: ASPSESSIONIDSAABARBQ=ACDDOHOCEKIEFOCKFBFIHJBC; _gat=1; __atuvc=129%7C46; __atuvs=582e898682f62926059; _ga=GA1.3.491207786.1479439414 
ip_url: 43.247.156.6 
ua: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36 
totalstring: ?500;http:/example.com:80/content/this.asp 

は、以下のようなエラーの詳細はありませんが、それはいつもです同じぺージに。私はそれを引き起こしているものを解決することはできません。

もっと詳細なエラーログがありますか?

答えて

0

Server.getLastError()のみ応答バッファはクライアントへのコンテンツフラッシュするために開始されるまで、この理由は、可能性が人口のまま:

  1. response.bufferは偽
  2. response.flushに設定されているが
  3. response.endと呼ばれてきていますされている

このドキュメントへの参照があります:

This method is available only before the .asp file has sent any content to the client.

これは、あなたのServer.getLastError()が空白のように見える理由を説明する唯一のものです。

関連する問題