Example #1
0
        public async Task <ResponseResult> LogoutSync()
        {
            var url = ImageWebAPIs.Logout;

            if (AppContext.Current.AuthToken == null)
            {
                return(ResponseResult.Empty);
            }

            var result = await WebAPIClient.GetAsync(url, AppContext.Current.AuthToken);

            return(result);
        }
 private async Task <Res> GetFromServiceSafely <Res, Req>(string path, Req request)
 {
     try
     {
         return(await _webAPIClient.GetAsync <Res, Req>(path, request));
     }
     catch (HttpResponseException ex)
     {
         if (ex.Response.StatusCode == HttpStatusCode.BadRequest)
         {
             LogException(ex).Wait();
         }
         else
         {
             throw new Exception(ex.Message, ex);
         }
     }
     return(default(Res));
 }