From e6181c24124d97f2fbc932b8a68311e625463156 Mon Sep 17 00:00:00 2001 From: uzvkl Date: Tue, 11 Jun 2019 23:05:52 +0200 Subject: Move dsa related stuff to subfolder --- dsa/FireBase/Extensions/TaskExtensions.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 dsa/FireBase/Extensions/TaskExtensions.cs (limited to 'dsa/FireBase/Extensions/TaskExtensions.cs') diff --git a/dsa/FireBase/Extensions/TaskExtensions.cs b/dsa/FireBase/Extensions/TaskExtensions.cs new file mode 100644 index 0000000..c955b3a --- /dev/null +++ b/dsa/FireBase/Extensions/TaskExtensions.cs @@ -0,0 +1,23 @@ +using System; +using System.Threading.Tasks; + +namespace Firebase.Database.Extensions +{ + 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; + } + } + } +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf