From 98bbaf76a201047d403f6533f05885505d3e4fcd Mon Sep 17 00:00:00 2001 From: Ben Carpenter Date: Mon, 14 Mar 2022 12:58:09 -0700 Subject: [PATCH] add HttpRequestException catch logic --- .../Utility/AuthorizationHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Microsoft.Devices.HardwareDevCenterManager/Utility/AuthorizationHandler.cs b/src/Microsoft.Devices.HardwareDevCenterManager/Utility/AuthorizationHandler.cs index c0eefe1..7fcdbd9 100644 --- a/src/Microsoft.Devices.HardwareDevCenterManager/Utility/AuthorizationHandler.cs +++ b/src/Microsoft.Devices.HardwareDevCenterManager/Utility/AuthorizationHandler.cs @@ -73,6 +73,12 @@ protected override async Task SendAsync(HttpRequestMessage { response = await base.SendAsync(clonedRequest, cancellationToken); } + catch (HttpRequestException) + { + //HDC request error, wait a bit and try again + Thread.Sleep(2000); + continue; + } catch (SocketException) { //HDC timed out, wait a bit and try again