diff --git a/NAPS2.Sdk/Scan/Internal/Escl/EsclScanDriver.cs b/NAPS2.Sdk/Scan/Internal/Escl/EsclScanDriver.cs index 9b7370a3f6..753b84ba43 100644 --- a/NAPS2.Sdk/Scan/Internal/Escl/EsclScanDriver.cs +++ b/NAPS2.Sdk/Scan/Internal/Escl/EsclScanDriver.cs @@ -141,6 +141,13 @@ public async Task GetDevices(ScanOptions options, CancellationToken cancelToken, throw; } } + catch (HttpRequestException ex) when (ex.InnerException is TaskCanceledException) + { + // A connection timeout manifests as TaskCanceledException + // TODO: Do we want to add a DeviceCommunicationException? It might be more appropriate here + // (and maps to WIA too) + throw new DeviceOfflineException(); + } catch (TaskCanceledException) { }