Je cherche HttpExceptions dans la sous Application_Error de mon global.asxServer.Transfer (« error_404.aspx ») dans Application_Error retourne une page blanche
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = HttpContext.Current.Server.GetLastError()
If ex IsNot Nothing Then
If TypeOf (ex) Is HttpUnhandledException Then
If ex.InnerException Is Nothing Then
Server.Transfer("error.aspx", False)
End If
ex = ex.InnerException
End If
If TypeOf (ex) Is HttpException Then
Dim httpCode As Integer = CType(ex, HttpException).GetHttpCode()
If httpCode = 404 Then
Server.ClearError()
Server.Transfer("error_404.aspx", False)
End If
End If
End If
End Sub
Je peux parcourir ce code et confirmer qu'il ne frappe le Server.Transfer ("error_404.aspx"), ainsi que le Page_Load de error_404.aspx, mais tout ce qu'il montre est une page blanche.
Assurez-vous d'ajouter un appel à votre système de consignation des erreurs. Si une exception non gérée se produit, vous voulez savoir si vous pouvez y remédier. – tsilb