public override bool IsResponsible(RealEstateServicesResponseWrapper serviceResponse)
 {
     if (serviceResponse.Exception is TaskCanceledException)
     {
         return(false);
     }
     return(serviceResponse.IsSuccess == false);
 }
Beispiel #2
0
        public override bool IsResponsible(RealEstateServicesResponseWrapper serviceResponse)
        {
            if (serviceResponse.Exception is HttpRequestException httpExcetion)
            {
                return(httpExcetion.Message?.Contains("Cannot write more bytes to the buffer") ?? false);
            }

            return(false);
        }
 public async Task HandleErrors(RealEstateServicesResponseWrapper serviceResponse)
 {
     if (serviceResponse == null)
     {
         Debug.WriteLine("ServiceHandlerManager.cs -> HandleErrors() -> AulaServiceResponse was null");
     }
     else
     {
         IServiceHandler handler = this.FirstOrDefault(x => x.IsResponsible(serviceResponse));
         if (handler != null)
         {
             await handler.Handle(serviceResponse);
         }
     }
 }
 public override bool IsResponsible(RealEstateServicesResponseWrapper serviceResponse)
 {
     return(serviceResponse != null && serviceResponse.HttpCode == HttpStatusCode.InternalServerError &&
            HttpClientManager.Instance.ConnectionUtils?.IsNetworkAvailable() == false);
 }
 public abstract bool IsResponsible(RealEstateServicesResponseWrapper serviceResponse);
 public async Task ShowDialog(RealEstateServicesResponseWrapper serviceResponse = null)
 {
     string message = GetMessage(serviceResponse);
     string title   = GetTitle(serviceResponse);
     string okBtn   = OkString;
 }
 public async Task Handle(RealEstateServicesResponseWrapper serviceResponse)
 {
     await ShowDialog(serviceResponse);
 }
 protected virtual string GetTitle(RealEstateServicesResponseWrapper serviceResponse = null)
 {
     return(FriendlyErrorTitle);
 }
 public async Task Handle(RealEstateServicesResponseWrapper serviceResponse)
 {
 }
 public bool IsResponsible(RealEstateServicesResponseWrapper serviceResponse)
 {
     return(serviceResponse.IsSuccess);
 }
 public override bool IsResponsible(RealEstateServicesResponseWrapper serviceResponse)
 {
     return(serviceResponse.HttpCode == HttpStatusCode.Unauthorized);
 }