From de0f076ef9ff546c9a90513259ad6c42cd2224b3 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Sat, 29 Sep 2018 16:51:26 +0200 Subject: added firebase api --- FireBase/Extensions/TaskExtensions.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 FireBase/Extensions/TaskExtensions.cs (limited to 'FireBase/Extensions/TaskExtensions.cs') 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 + { + /// + /// Instead of unwrapping it throws it as it is. + /// + public static async Task WithAggregateException(this Task source) + { + try + { + await source.ConfigureAwait(false); + } + catch (Exception ex) + { + throw source.Exception ?? ex; + } + } + } +} -- cgit v1.2.3-54-g00ecf