diff options
author | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-29 17:19:43 +0200 |
---|---|---|
committer | TrueKuehli <rctcoaster2000@hotmail.de> | 2018-09-29 17:19:43 +0200 |
commit | b83fc90abacc73262e0f8404cebadf6d64eb10ae (patch) | |
tree | d63b921c9bcdf8d381fc02ecfb0a1dd425ebb561 /FireBase/Extensions/TaskExtensions.cs | |
parent | 586d564f3c4c509c1aae931331e96f0382178f80 (diff) | |
parent | 680967aee589e4a8d277044b204de07cbe32f41e (diff) |
Merge branch 'WebApi' of https://github.com/TrueDoctor/DiscoBot into WebApi
Merged the stuffs
Diffstat (limited to 'FireBase/Extensions/TaskExtensions.cs')
-rw-r--r-- | FireBase/Extensions/TaskExtensions.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/FireBase/Extensions/TaskExtensions.cs b/FireBase/Extensions/TaskExtensions.cs new file mode 100644 index 0000000..26bbde6 --- /dev/null +++ b/FireBase/Extensions/TaskExtensions.cs @@ -0,0 +1,23 @@ +namespace Firebase.Database.Extensions +{ + using System; + using System.Threading.Tasks; + + public static class TaskExtensions + { + /// <summary> + /// Instead of unwrapping <see cref="AggregateException"/> it throws it as it is. + /// </summary> + public static async Task WithAggregateException(this Task source) + { + try + { + await source.ConfigureAwait(false); + } + catch (Exception ex) + { + throw source.Exception ?? ex; + } + } + } +} |