You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varpollingTask=Task.Run(()=>{varobserver=Observable.Interval(TimeSpan.FromSeconds(1)).Select(async _ =>_CurrentlyPlaying=await_spotifyClient?.Player?.GetCurrentlyPlaying(new())).Select(track =>CurrentTrackInfo.GetCurrentTrackInfo(_CurrentlyPlaying)).Distinct().Where(track =>trackis not null).Subscribe(track =>_CurrentTrackChanged?.Invoke(track));if(ct.IsCancellationRequested){observer.Dispose();_CurrentTrackErrorDetected.Invoke();}_Logger.WriteLog("[SpotifyService] - Polling Start....",Logger.LogLevel.Debug);},ct);try{awaitpollingTask;}catch(Exceptionex){if(pollingTask.ExceptionisAggregateExceptionagex){agex.Handle((exp)=>{agex.InnerExceptions.ToList().ForEach((ages)=>{_Logger.WriteLog($"[SpotifyService] - Polling error... {ages.Message}",Logger.LogLevel.Error);});// If you set it to true, the exception will not be thrown again because it has already been handled.// Or else, the exception will be re-throw as it is still unhandled.returnfalse;});}}
The text was updated successfully, but these errors were encountered:
Task.Run() な中で例外処理してしまっているので、取得できていないと思われる
https://github.com/Sagiri-Dev/Sagiri/blob/feature-plus-soundcloud/Sagiri/Services/Spotify/SpotifyService.cs#L85-L108
どうするか?
一度 Task として受けた後、try - catch 内で待ち合わせて例外処理する
The text was updated successfully, but these errors were encountered: