私はしばらくの間WindowsPhoneストアにアプリを持っていて、数人の人がバグについて私にメールを送ってきました。問題を再現できなかったため、アプリにバグセンスを追加しました。今、私は素晴らしいエラーレポートを受け取り始めています。
今日受け取ったレポートの1つに、スタックトレースに次のようなものがありました
at Microsoft.Phone.Reactive.ObservableExtensions.b__3[TSource](Exception exception)
at Microsoft.Phone.Reactive.AnonymousObserver`1.Error(Exception exception)
at Microsoft.Phone.Reactive.AbstractObserver`1.OnError(Exception exception)
at Microsoft.Phone.Reactive.AnonymousObservable`1.AutoDetachObserver.Error(Exception exception)
at Microsoft.Phone.Reactive.AbstractObserver`1.OnError(Exception exception)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass161`1.<>c__DisplayClass163.b__160()
at Microsoft.Phone.Reactive.CurrentThreadScheduler.Trampoline.Run()
at Microsoft.Phone.Reactive.CurrentThreadScheduler.EnsureTrampoline(Action action)
at Microsoft.Phone.Reactive.AnonymousObservable`1.Subscribe(IObserver`1 observer)
at Microsoft.Phone.Reactive.Observable.<>c__DisplayClass323`1.<>c__DisplayClass325.b__31e()
at Microsoft.Phone.Reactive.ThreadPoolScheduler.<>c__DisplayClass5.b__3(Object _)
at System.Threading.Timer.ring()
コメントは、操作がタイムアウトになりました。
問題は、アプリ全体のさまざまな場所でObservableを使用しているので、エラーが発生している場所を追跡するにはどうすればよいですか?
編集:私が使用しているObservable.TimeOutを見つけたところですが、これが原因である可能性がありますか?
IObservable<IEvent<TheWeatherBug.GetLocationListCompletedEventArgs>> observable =
Observable.FromEvent<TheWeatherBug.GetLocationListCompletedEventArgs>(WeatherBugService, "GetLocationListCompleted").Take(1);
var ObservableTimeout = Observable.Timeout(observable, TimeSpan.FromSeconds(10));
ObservableTimeout.Subscribe(w =>
{
pbarSearch.Visibility = System.Windows.Visibility.Collapsed;
if (w.EventArgs.Error == null)
{
locations = w.EventArgs.Result;
foreach (TheWeatherBug.ApiLocationData ap in locations)
{
if (ap.City.Contains(location))
if (!lbxLocations.Items.Contains(ap.City + " - " + ap.Country))
lbxLocations.Items.Add(ap.City + " - " + ap.Country);
}
if (lbxLocations.Items.Count == 0)
MessageBox.Show("Sorry could not find a city called " + location);
}
});