Skip to content

Commit 0fe9858

Browse files
authored
Merge pull request #21 from TORISOUP/fix_login
ログイン時の例外対応
2 parents d7d60bc + d883769 commit 0fe9858

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Assets/TORISOUP/NicoliveClient/Plugins/Client/NiconicoUserClient.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,18 @@ public static async UniTask<NiconicoUser> LoginAsync(string mail, string passwor
3434
using var uwr = UnityWebRequest.Post(url, form);
3535
uwr.redirectLimit = 0;
3636

37-
await uwr.SendWebRequest().ToUniTask(cancellationToken: ct);
37+
try
38+
{
39+
await uwr.SendWebRequest().ToUniTask(cancellationToken: ct);
40+
}
41+
catch (Exception ex) when (ex is not OperationCanceledException)
42+
{
43+
// Redirect limit exceededは無視
44+
if (!ex.Message.Contains("Redirect limit exceeded"))
45+
{
46+
throw;
47+
}
48+
}
3849

3950
var cookie = uwr.GetResponseHeader("Set-Cookie");
4051
var match = userSessionRegex.Match(cookie);
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023.8.28
1+
2023.8.28.1

0 commit comments

Comments
 (0)