Skip to content

Commit

Permalink
Merge branch 'master' into storage-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy authored Aug 2, 2017
2 parents 9a5d525 + 46abae5 commit dca2603
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion osu.Framework/Extensions/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -153,7 +154,16 @@ public static string GetDescription(this Enum value)
public static void ThrowIfFaulted(this Task task)
{
if (task.IsFaulted)
ExceptionDispatchInfo.Capture(task.Exception?.InnerException).Throw();
{
Exception e = task.Exception;

Debug.Assert(e != null);

while (e.InnerException != null)
e = e.InnerException;

ExceptionDispatchInfo.Capture(e).Throw();
}
}

/// <summary>
Expand Down

0 comments on commit dca2603

Please sign in to comment.