Skip to content

Commit

Permalink
修复重复读取 responseMessage.Content 引发的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
natsurainko committed Dec 13, 2024
1 parent e3d43a6 commit 517850a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private async Task<string> AuthXstsAsync(string xblToken, CancellationToken canc
throw new FormatException("Response is null");
if (xstsResponse.Token is null)
throw new FormatException("Token is null");
}
}
catch (Exception e) when (e is JsonException || e is FormatException)
{
throw new AuthException("Error in XSTS authentication\n" + xstsResponseMessage.Content.ReadAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ private async Task<YggdrasilAccount[]> ParseResponseAsync(HttpResponseMessage re

if (response?.AvailableProfiles is null && response?.SelectedProfile is null)
throw new FormatException("Response does not contain any profile");
}
catch (FormatException ex)
{
throw new YggdrasilAuthenticationException(ex.Message);
}
catch (Exception)
{
Expand Down

0 comments on commit 517850a

Please sign in to comment.