protected ViewResult HandleException(string viewName, object model, Exception exc) { exc.Log(); ViewBag.Container = model; this.ModelState.AddModelError("_Form", (this.Request.IsLocal) ? exc.Message : "An unknown error has occurred."); return View(viewName, model); }
protected ViewResult HandleException(object model, Exception exc) { exc.Log(); ViewBag.Container = model; if(exc is MessageException) this.AddErrorMessage(exc.Message); else this.ModelState.AddModelError("_Form", (this.Request.IsLocal) ? exc.Message : "An unknown error has occurred."); return View(model); }
static void hubConnection_Error(Exception obj) { obj.Log("Signalr connection issue"); if (obj is UnauthorizedAccessException || obj.InnerException is UnauthorizedAccessException) { Logging.DebugMessage("Token expiry... refreshing oauth token"); try { hubConnection.Stop(); } catch (Exception) { // ignored } hubConnection.Dispose(); ConfigCacheHelper.SetCredentials(hubConnection); hubConnection.Start(); } }
public void ToConsole(Exception e) { if (e == null) { return; } lock (VitaNexCore.ConsoleLock) { Console.Write('['); Utility.PushColor(ConsoleColor.Green); Console.Write(Name); Utility.PopColor(); Console.Write("]: "); Utility.PushColor(ConsoleColor.DarkRed); Console.WriteLine((Quiet && !Debug) ? e.Message : e.ToString()); Utility.PopColor(); } if (Debug) { e.Log(IOUtility.EnsureFile(VitaNexCore.LogsDirectory + "/Debug/" + TypeOf.FullName + ".log")); } }
public bool HandleError(Exception error) { error.Log(); return false; }
internal static void PrintLuaStackTrace(Exception e) { var data = LuaExceptionData.GetData(e); if (data != null) { foreach (var frame in data) { e.Log().Error(frame.ToString()); } } }