예제 #1
0
        protected async Task <T> ExecuteSafeApiRequestAsync <T>(Func <Task <T> > func)
        {
            try
            {
                return(await func());
            }
            catch (ApiUnauthorizedException)
            {
                await ShowErrorAsync("You have been unauthorized. Please, login again.");

                _menuNavigationHelper.NavigateToLoginPage();
            }
            catch (Exception ex)
            {
                await ShowErrorAsync(ex.Message);
            }

            return(default(T));
        }