Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error message #118

Open
Shurron opened this issue May 4, 2023 · 3 comments
Open

Unclear error message #118

Shurron opened this issue May 4, 2023 · 3 comments

Comments

@Shurron
Copy link

Shurron commented May 4, 2023

I'm using v3.2.6

_pubSub.OnPubSubServiceError += _pubSub_OnPubSubServiceError;

private void _pubSub_OnPubSubServiceError(object sender, TwitchLib.PubSub.Events.OnPubSubServiceErrorArgs e)
{
	Console.WriteLine($"PubSub: {e.Exception}");
}

Everything working fine for about 4 hours, but then I'm getting this error:

PubSub: System.OperationCanceledException: The operation was canceled.
at System.Collections.Concurrent.BlockingCollection`1.TryTakeWithNoTimeValidation(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken, CancellationTokenSource combinedTokenSource)
at System.Collections.Concurrent.BlockingCollection`1.TryTake(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Collections.Concurrent.BlockingCollection`1.Take(CancellationToken cancellationToken)
at TwitchLib.Communication.Services.Throttlers.b__28_0()
PubSub: System.OperationCanceledException: The operation was canceled.
at System.Collections.Concurrent.BlockingCollection`1.TryTakeWithNoTimeValidation(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken, CancellationTokenSource combinedTokenSource)
at System.Collections.Concurrent.BlockingCollection`1.TryTake(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Collections.Concurrent.BlockingCollection`1.Take(CancellationToken cancellationToken)
at TwitchLib.Communication.Services.Throttlers.b__29_0()

My problem is access token expiring (I think so), but how can I be sure what's actually happenning from this error message? There should be some more user-friendly error message from Twitch describing what's going wrong. Could you please make a changes to provide us this error message?

@Mahsaap
Copy link
Member

Mahsaap commented May 4, 2023

add onlog event and see if anything additional shows.

@Shurron
Copy link
Author

Shurron commented May 5, 2023

With OnLog event output now looks like this:

[2023-05-05 17:44:42] [Debug] PubSub::OnLog: { "type": "RECONNECT" }
[2023-05-05 17:44:42] [Error] PubSub: System.OperationCanceledException: The operation was canceled.
at System.Collections.Concurrent.BlockingCollection`1.TryTakeWithNoTimeValidation(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken, CancellationTokenSource combinedTokenSource)
at System.Collections.Concurrent.BlockingCollection`1.TryTake(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Collections.Concurrent.BlockingCollection`1.Take(CancellationToken cancellationToken)
at TwitchLib.Communication.Services.Throttlers.b__28_0()
[2023-05-05 17:44:42] [Error] PubSub: System.OperationCanceledException: The operation was canceled.
at System.Collections.Concurrent.BlockingCollection`1.TryTakeWithNoTimeValidation(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken, CancellationTokenSource combinedTokenSource)
at System.Collections.Concurrent.BlockingCollection`1.TryTake(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Collections.Concurrent.BlockingCollection`1.Take(CancellationToken cancellationToken)
at TwitchLib.Communication.Services.Throttlers.b__29_0()
[2023-05-05 17:44:59] [Debug] PubSub::OnLog: {"type":"RESPONSE","error":"","nonce":"CNCrhM41"}

@Mahsaap
Copy link
Member

Mahsaap commented May 5, 2023

I'm keep seeing blocking, your not running this in a UI class by any chance? But it does look like reconnect is mentioned. So it could be the token. Have you verified it's working with API?
Also showing the relevant code could help since I'm kinda guessing at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants