diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index b63b34f..bd342c9 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -4,6 +4,7 @@ using System.Windows.Forms; using Microsoft.Win32; using Bloxstrap.Integrations; +using Bloxstrap.Resources; namespace Bloxstrap { @@ -1189,9 +1190,20 @@ namespace Bloxstrap Directory.CreateDirectory(contentFonts); - var response = await App.HttpClient.GetAsync(App.Settings.Prop.EmojiType.GetUrl()); - await using var fileStream = new FileStream(emojiFontLocation, FileMode.CreateNew); - await response.Content.CopyToAsync(fileStream); + try + { + var response = await App.HttpClient.GetAsync(App.Settings.Prop.EmojiType.GetUrl()); + response.EnsureSuccessStatusCode(); + await using var fileStream = new FileStream(emojiFontLocation, FileMode.CreateNew); + await response.Content.CopyToAsync(fileStream); + } + catch (HttpRequestException ex) + { + App.Logger.WriteLine(LOG_IDENT, $"Failed to fetch emoji preset from Github"); + App.Logger.WriteException(LOG_IDENT, ex); + Frontend.ShowMessageBox(string.Format(Strings.Bootstrapper_EmojiPresetFetchFailed, App.Settings.Prop.EmojiType), MessageBoxImage.Warning); + App.Settings.Prop.EmojiType = EmojiType.Default; + } } // check custom font mod diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 2a7a0da..403f056 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -133,6 +133,15 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to Failed to fetch the {0} emoji preset. Your preferred emoji type has been set back to default.. + /// + public static string Bootstrapper_EmojiPresetFetchFailed { + get { + return ResourceManager.GetString("Bootstrapper.EmojiPresetFetchFailed", resourceCulture); + } + } + /// /// Looks up a localized string similar to You must first install Bloxstrap before uninstalling.. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index d24de5b..27b3a1c 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -142,6 +142,9 @@ Would you like to switch to the default channel ({1})? Roblox was launched via a deeplink, however the desktop app is required for deeplink launching to work. Because you've opted to disable the desktop app, it will temporarily be re-enabled for this launch only. + + Could not apply the {0} emoji mod preset because of a network error. To try again, please reconfigure the option in the Bloxstrap Menu. + You must first install Bloxstrap before uninstalling. @@ -1044,4 +1047,4 @@ Selecting 'No' will ignore this warning and continue installation. Would you like to switch your preferred channel to {0}? - \ No newline at end of file +