When a api call fails without a real reason, f.e. 502 gateway error, retry that call up to 5 times as it will go away with the next request usually.