Пример #1
0
 public static void Log(WpException exception)
 {
     if (WriteInConsole)
         ConsoleLogger.Log(exception);
     if (WriteInDiagnostics)
         DiagnosticLogger.Log(exception);
     if (WriteInDb)
         DbLog.Log(exception);
     if (WriteInFile)
         FileLogger.Log(exception, LogFilePath);
 }
 public static MessagingCenterResponse CreateError(WpException exception)
 {
     return new MessagingCenterResponse
     {
         Content = string.Empty,
         ErrorCode = exception.ErrorCode,
         Error = exception.Message,
         Metadata = exception.Metadata,
         Exception = exception
     };
 }
Пример #3
0
        public MessagingCenterResponse ErrorResponse(MessagingCenterPackage package, string message, int errorCode, Exception exception = null)
        {
            WpException mex = new WpException(errorCode, message, exception)
            {
                Metadata = JsonConvert.SerializeObject(package)
            };

            Logger.Log(mex);

            return MessagingCenterResponse.CreateError(mex);
        }
Пример #4
0
 public static void Log(WpException exception)
 {
     WriteLog($"Error code : {exception.ErrorCode}\n" +
              $"Exception : {exception.Message}\n" +
              $"StackTrace : {exception.StackTrace}\n");
 }
Пример #5
0
 public static void ShowError(WpException exception, Form parent = null)
 {
     ShowError("ERROR : " + exception.Message + "\n" + "ERROR CODE : " + exception.ErrorCode + "\n" + (!string.IsNullOrEmpty(exception.Metadata) ? "METADATA : " + exception.Metadata : string.Empty), parent);
 }
Пример #6
0
 public static void Log(WpException exception, string filePath)
 {
     throw new NotImplementedException();
 }