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);
        }
Esempio n. 3
0
 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();
     }
 }
Esempio n. 4
0
		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"));
			}
		}
Esempio n. 5
0
 public bool HandleError(Exception error)
 {
     error.Log();
     return false;
 }
Esempio n. 6
0
        internal static void PrintLuaStackTrace(Exception e)
        {
            var data = LuaExceptionData.GetData(e);

            if (data != null)
            {
                foreach (var frame in data)
                {
                    e.Log().Error(frame.ToString());
                }
            }
        }