private void WriteException(ExceptionWrapper ex) { lock (_lock) { try { var exceptions = GetExceptions(); exceptions.Add(ex); File.WriteAllText(_exceptionLogPath, JsonConvert.SerializeObject(exceptions)); } catch { } } }
public static void Handle(Exception ex) { var wrapper = new ExceptionWrapper(ex); Task.Run(() => Instance.WriteException(wrapper)); }