2011-07-11 17 views
1

マイカスタムエラーハンドラリターンを返します。カスタムエラーハンドラは、一般的なエラーハンドラとは異なるエラー

Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.

Source: System.Web

Stack Track: at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.inc_iframe_eventdetail_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\c30f285f\68ea8ff1\App_Web_g4uza9zi.4.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Target Site: Boolean HandleError(System.Exception)

しかし、一般的なエラーハンドラが返されます。

Server Error in '/' Application. Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Source Error:

Line 44: ChurchEventDataSource.SelectParameters.Add("ChurchEventId", Request.QueryString["EventId"]); Line 45: Line 46: EventFormView.DataBind(); Line 47: break; Line 48:

Source File: c:\Sites\Altruistic\ChurchFinder\Inc\Iframe\EventDetail.aspx.cs Line: 46

明らか

、私が最も詳細が欲しいです説明は可能です。

+0

***カスタムエラーハンドラ***と***汎用エラーハンドラ***の_code_はどれですか? 'Global.asax Application_Error'?あなたの** web.config **については 'customerrors'と' httperrors' *セクション*について? –

答えて

0

ここでカスタムエラーハンドラ&はどのように例外を取得していますか?ほとんどの場合、例外を取得するにはHttpServerUtility.GetLastErrorメソッドを使用している可能性があります。その場合、実際の例外オブジェクトのInnerExceptionプロパティ(nullでない場合)を使用してください。実際の例外が発生します。

+0

閉じる、私はGlobal.asaxでServer.GetLastErrorを使用していますが、InnerExceptionプロパティはほとんどの場合、何らかのエラーが発生したときにHttpUnhandledExceptionを返します。 – coderpros

+0

ああ....考え出した。私は.InnerExceptionを使用していたはずだったときに.Messageを使用していました。 :|正しい方向に私を指してくれてありがとう。 – coderpros

関連する問題