Exemplo n.º 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
     };
 }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 public static void Log(WpException exception)
 {
     WriteLog($"Error code : {exception.ErrorCode}\n" +
              $"Exception : {exception.Message}\n" +
              $"StackTrace : {exception.StackTrace}\n");
 }
Exemplo 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);
 }
Exemplo n.º 6
0
 public static void Log(WpException exception, string filePath)
 {
     throw new NotImplementedException();
 }