diff options
author | Brian Lagunas <brianlagunas@users.noreply.github.com> | 2017-05-26 01:10:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 01:10:26 +0300 |
commit | 1e9bd24e41bc8e73b7b8c557186978f4173a3c72 (patch) | |
tree | 6949e55e5e99fcb8a0f0a63c3ee49ac76c1aa6d4 | |
parent | 1f000ea61c829ccc23beeeaf66f213d8497b4b9a (diff) | |
parent | 08658ac5782c989f5963c68a4dbfadf0db129ee3 (diff) |
Merge pull request #1061 from PrismLibrary/NavigationSwallowExceptions
[XF] NavigationService: no longer swallow exceptions
-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); } } |