From 1ccec2a6751d0495754788e7e1b007d9ccedcd9d Mon Sep 17 00:00:00 2001 From: 1011025m <37438176+1011025m@users.noreply.github.com> Date: Sun, 29 Oct 2023 20:04:28 +0800 Subject: [PATCH] Handle error when channel is not available to user --- Bloxstrap/Bootstrapper.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index d68c50c..eafb5c7 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -229,10 +229,19 @@ namespace Bloxstrap } catch (HttpResponseException ex) { - if (ex.ResponseMessage.StatusCode != HttpStatusCode.NotFound) + if (ex.ResponseMessage.StatusCode != HttpStatusCode.NotFound && ex.ResponseMessage.StatusCode != HttpStatusCode.Unauthorized) throw; - App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a WindowsPlayer build does not exist for {App.Settings.Prop.Channel}"); + if (ex.ResponseMessage.StatusCode == HttpStatusCode.NotFound) + App.Logger.WriteLine(LOG_IDENT, $"Reverting enrolled channel to {RobloxDeployment.DefaultChannel} because a WindowsPlayer build does not exist for {App.Settings.Prop.Channel}"); + // Janky fix for error 401 ~25/10/2023 + if (ex.ResponseMessage.StatusCode == HttpStatusCode.Unauthorized) + { + App.Logger.WriteLine(LOG_IDENT, $"Setting channel to {RobloxDeployment.DefaultChannel} because channel {App.Settings.Prop.Channel} is unavailable to the user."); + Controls.ShowMessageBox( + $"Release channel {App.Settings.Prop.Channel} is not available to you. It has been reset to {RobloxDeployment.DefaultChannel}.", MessageBoxImage.Information); + } + App.Settings.Prop.Channel = RobloxDeployment.DefaultChannel; clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel); }