Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Checking if getting items from the POIStore results in exception #497

Merged
merged 1 commit into from
Apr 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,19 @@ public async Task<bool> StopRecordingTrip()
Logger.Instance.Report(ex);
}

List<POI> poiList = new List<POI>(await StoreManager.POIStore.GetItemsAsync(CurrentTrip.Id));
List<POI> poiList = new List<POI>();
try
{
poiList = new List<POI>(await StoreManager.POIStore.GetItemsAsync(CurrentTrip.Id));
}
catch (Exception ex)
{
//Intermittently, Sqlite will cause a crash for WinPhone saying "unable to set temporary directory"
//If this call fails, simply use an empty list of POIs
Logger.Instance.WriteLine("Unable to get POI Store Items.");
Logger.Instance.Report(ex);
}

CurrentTrip.HardStops = poiList.Where(p => p.POIType == POIType.HardBrake).Count();
CurrentTrip.HardAccelerations = poiList.Where(p => p.POIType == POIType.HardAcceleration).Count();

Expand Down