<commit_before>﻿using Avalonia.Threading;
using System;
using System.IO;

namespace WalletWasabi.Gui
{
	public static class Utils
	{
		public static string GetNextWalletName()
		{
			for (int i = 0; i < int.MaxValue; i++)
			{
				if (!File.Exists(Path.Combine(Global.WalletsDir, $"Wallet{i}.json")))
				{
					return $"Wallet{i}";
				}
			}

			throw new NotSupportedException("This is impossible.");
		}

		public static void PostLogException(this Dispatcher dispatcher, Action action, DispatcherPriority priority = DispatcherPriority.Normal)
		{
			try
			{
				dispatcher.Post(action, priority);
			}
			catch (Exception ex)
			{
				Logging.Logger.LogDebug<Dispatcher>(ex);
			}
		}
	}
}
<commit_msg>fix catch mechanism<commit_after>﻿using Avalonia.Threading;
using System;
using System.IO;
using System.Threading.Tasks;

namespace WalletWasabi.Gui
{
	public static class Utils
	{
		public static string GetNextWalletName()
		{
			for (int i = 0; i < int.MaxValue; i++)
			{
				if (!File.Exists(Path.Combine(Global.WalletsDir, $"Wallet{i}.json")))
				{
					return $"Wallet{i}";
				}
			}

			throw new NotSupportedException("This is impossible.");
		}

		public static void PostLogException(this Dispatcher dispatcher, Func<Task> action, DispatcherPriority priority = DispatcherPriority.Normal)
		{
			dispatcher.Post(async () =>
			{
				try
				{
					await action();
				}
				catch (Exception ex)
				{
					Logging.Logger.LogDebug<Dispatcher>(ex);
				}
			}, priority);
		}

		public static void PostLogException(this Dispatcher dispatcher, Action action, DispatcherPriority priority = DispatcherPriority.Normal)
		{
			dispatcher.Post(() =>
			{
				try
				{
					action();
				}
				catch (Exception ex)
				{
					Logging.Logger.LogDebug<Dispatcher>(ex);
				}
			}, priority);
		}
	}
}

{'fraction_non_alphanumeric': 0.12223451327433628, 'fraction_numerical': 0.0011061946902654867, 'mean_word_length': 3.256470588235294, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '630086', 'n_tokens_mistral': 738, 'n_tokens_neox': 589, 'n_words': 127}