나는 다음과 같은 코드에 구현 된 사용자 지정 오류 처리기를 가지고 : 왜 사용자 정의 오류 처리가 작동하지 않습니까?
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
'get the exception
Dim ex = Server.GetLastError()
'log it
ex.LogToFile()
'clear the error
Server.ClearError()
'build route data to route this exception to ErrorController
Dim routeData = New RouteData()
routeData.Values.Add("controller", "Error")
routeData.Values.Add("action", "Index")
routeData.Values.Add("exception", ex)
'route to the error controller, preserving the context
Dim controller As IController = New Controllers.ErrorController()
controller.Execute(New RequestContext(New HttpContextWrapper(Context), routeData))
End Sub
그런 다음
/error/index
액션 메소드는 사용자 친화적 인 방법으로 예외를 보여줍니다. 내 개발 컴퓨터에서이 잘 작동합니다. 하지만 배포 된 서버에서 예외가 발생하면 내 오류 메시지 대신에
%SystemDrive%\inetpub\custerr\<LANGUAGE-TAG>\500.htm
과 같이 미리 준비된 오류 페이지를 사용하려고합니다.
내 자신의 500 페이지를 지정하면 그것을 사용하지만 사용자 정의 처리는 사용하지 않습니다.
나는과 같이 500 페이지를 제거하는 경우 :
<httpErrors>
<remove statusCode="500" subStatusCode="-1" />
</httpErrors>
난 그냥이 메시지와 함께 죽음의 흰색 화면을 얻을
: 그래서
The page cannot be displayed because an internal server error has occurred.
, 어떻게 내 오류가 어떻게 처리 얻을 수 있습니다 옳은 일?