Image on dev.to

Handling network errors is one of the problems that developers face while creating their apps. In my previous article I discussed handling “No internet connection” errors. Today I am going to review retrying other failed network requests automatically.

For most common network request errors, such as having code of a series of 500 HTTP error codes (server errors), it makes sense to apply a retry policy that implies several trials.

This article will have five parts.

Part 1 — Review of theoretical aspects of retry policy.

Part 2 — Present the base RetryableExecutor class, which encapsulates retry logic.

Part 3…


It is not a secret that every network request could potentially fail for a multitude of reasons. The difficulty is that a failed network request results should be handled in different ways based on reasons they failed. For most other common network request errors, such as having code of a series of 500 HTTP error codes (server errors), it makes sense to apply a retry policy that implies several trials. In this article, I will discuss handling “No internet connection” errors in detail. In the next article, I will review retrying failed network requests automatically after a calculated timeout.

What…

Denis Druzhinin

Senior Android Developer at AltoPass

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store