handleerror

    0熱度

    1回答

    我正在處理一個MVC應用程序,我想要顯示自定義錯誤頁面並避免顯示錯誤的死亡黃色屏幕。我在全局過濾器配置中添加了HandleError過濾器。 public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new HandleErrorAttribute()); }

    0熱度

    1回答

    我檢查用戶的令牌登錄,如果認證失敗(返回401錯誤)我想重定向到登錄。我遇到的問題是,當我犯了錯誤趕上router.navigate不起作用。 constructor(private http: Http , private router : Router) authUser(){ return this.http.get(this.baseEndPoint+'/auth/use

    1熱度

    1回答

    我通過創建自己的屬性來處理MVC中的HandleErrorAttribute,該屬性處理Ajax請求期間引發的異常。該屬性是在這裏: public class AjaxAwareHandleErrorAttribute : HandleErrorAttribute { public string PartialViewName { get; set; } public ov

    7熱度

    2回答

    在我的web.config我已經包括了:現在死亡的黃色屏幕不再顯示 <customErrors mode="On" /> 。 我想我必須包含的HandleError屬性我控制器的方法或類本身: [HandleError] public ActionResult About() { throw new Exception("Just an exception"); ret

    0熱度

    1回答

    我正在開發Rails 3並使用Nokogiri。我的控制器解析多個網站並在我的視圖上顯示結果。問題是,當其中一個站點不可用時(例如403或503錯誤),所有webapp因爲該站點而崩潰。 我的問題:有沒有一種方法可以在Nokogiri打開它之前檢查解析頁面的可用性,或者更好地通過/忽略不可用性? 感謝 我的控制器的一部分: Docvariable1 = Nokogiri::HTML(open("h

    3熱度

    3回答

    我在我的控制器上設置了[HandleError]屬性。 這是我的動作方法: public ActionResult ShowError() { throw new NullReferenceException(); return View(); } 這個動作方法具有對應的圖。 我已經在配置 <customErrors mode="On"> </

    0熱度

    1回答

    我有一個ASP.NET MVC 4應用程序。我想使用我的自定義句柄錯誤屬性。爲此我寫了這個類: public class MyHandleErrorAttribute : HandleErrorAttribute { public void OnException(ExceptionContext filterContext) { Debug.Wri

    0熱度

    1回答

    美好的一天!試圖解決問題。我使用的處理網站上的所有錯誤的方法(該方法在一個人的博客上發現) 的Global.asax protected void Application_Error(object sender, EventArgs e) { HttpContext ctx = HttpContext.Current; Exception ex = ctx.Server.Ge

    0熱度

    1回答

    我試圖很容易地處理Common Lisp中的錯誤,但是我遇到了一些問題。 特別是,我有這個功能。 (defun function1 (m) (ignore-errors (and (condition-1) (condition-2)) (format t "Error message"))) 我只是想,如果某些條件無法進入 (and (condition-1) (conditio

    0熱度

    1回答

    我試圖重定向到出錯頁面。但它不起作用。 它只是給 - Uh-oh, something went wrong! Error Code: 500在瀏覽器上的消息,而不是重定向到錯誤頁面。錯誤頁面已存在於共享文件夾中。 下面是代碼在控制器: [HandleError(View = "Error")] public ActionResult Index() { int u