diff options
author | Brian Lagunas <brian.lagunas@live.com> | 2017-05-25 04:14:42 +0300 |
---|---|---|
committer | Brian Lagunas <brian.lagunas@live.com> | 2017-05-25 04:14:42 +0300 |
commit | 08658ac5782c989f5963c68a4dbfadf0db129ee3 (patch) | |
tree | 6949e55e5e99fcb8a0f0a63c3ee49ac76c1aa6d4 | |
parent | 1f000ea61c829ccc23beeeaf66f213d8497b4b9a (diff) |
no longer swallow exception
no longer swollow the exceptions made in the NavigateAsync method. We log and rethrow.
-rw-r--r-- | Source/Xamarin/Prism.Forms/Navigation/PageNavigationService.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/Xamarin/Prism.Forms/Navigation/PageNavigationService.cs b/Source/Xamarin/Prism.Forms/Navigation/PageNavigationService.cs index ec5b262..e11f774 100644 --- a/Source/Xamarin/Prism.Forms/Navigation/PageNavigationService.cs +++ b/Source/Xamarin/Prism.Forms/Navigation/PageNavigationService.cs @@ -119,7 +119,7 @@ namespace Prism.Navigation catch (Exception e) { _logger.Log(e.ToString(), Category.Exception, Priority.High); - return Task.FromResult<object>(null); + throw; } finally { @@ -458,23 +458,24 @@ namespace Prism.Navigation return useModalNavigation; } - protected virtual async Task DoPush(Page currentPage, Page page, bool? useModalNavigation, bool animated) + protected virtual Task DoPush(Page currentPage, Page page, bool? useModalNavigation, bool animated) { if (page == null) - return; + throw new ArgumentNullException(nameof(page)); if (currentPage == null) { _applicationProvider.MainPage = page; + return Task.FromResult<object>(null); } else { bool useModalForPush = UseModalNavigation(currentPage, useModalNavigation); if (useModalForPush) - await currentPage.Navigation.PushModalAsync(page, animated); + return currentPage.Navigation.PushModalAsync(page, animated); else - await currentPage.Navigation.PushAsync(page, animated); + return currentPage.Navigation.PushAsync(page, animated); } } |