From f5c27d99a4f3a3d9255a7cebe554703a2612dff4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 6 Mar 2017 19:59:40 +0900 Subject: [PATCH] Add error handling to import process (resolves await warning). --- osu.Game/IPC/BeatmapImporter.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/IPC/BeatmapImporter.cs b/osu.Game/IPC/BeatmapImporter.cs index b6ce4d1e35..bb3589c64f 100644 --- a/osu.Game/IPC/BeatmapImporter.cs +++ b/osu.Game/IPC/BeatmapImporter.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Threading.Tasks; +using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Database; @@ -13,7 +14,7 @@ namespace osu.Game.IPC private IpcChannel channel; private BeatmapDatabase beatmaps; - public BeatmapImporter(GameHost host, BeatmapDatabase beatmaps = null) + public BeatmapImporter(GameHost host, BeatmapDatabase beatmaps = null) { this.beatmaps = beatmaps; @@ -35,7 +36,7 @@ namespace osu.Game.IPC { Debug.Assert(beatmaps != null); - ImportAsync(msg.Path); + ImportAsync(msg.Path).ContinueWith(t => Logger.Error(t.Exception, @"error during async import"), TaskContinuationOptions.OnlyOnFaulted); } }