示例#1
0
 static async public void ExceptionMessage(Exception ex, object window)
 {
     try
     {
         //Message
         if (ex.HResult == -2146233088)
         {
             Toaster.ShowError(window as Window, message: MainWindow.resourcemanager.GetString("trNoInternetConnection"), animation: ToasterAnimation.FadeIn);
         }
         else
         {
             Toaster.ShowError(window as Window, message: ex.HResult + " || " + ex.Message, animation: ToasterAnimation.FadeIn);
         }
         ErrorClass errorClass = new ErrorClass();
         errorClass.num          = ex.HResult.ToString();
         errorClass.msg          = ex.Message;
         errorClass.stackTrace   = ex.StackTrace;
         errorClass.targetSite   = ex.TargetSite.ToString();
         errorClass.createUserId = MainWindow.userLogin.userId;
         await errorClass.Save(errorClass);
     }
     catch
     {
     }
 }