From 2c5ceeabdba7799e2d2db886fa66069f02e9674e Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 21 Apr 2023 21:24:14 +1000 Subject: [PATCH] Handle OSError when attempting connection (#339) --- lib/api.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/api.dart b/lib/api.dart index 7a41572d..be2ba808 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -1078,6 +1078,10 @@ class InvenTreeAPI { debug("TimeoutException at ${url}"); showTimeoutError(url); return null; + } on OSError catch (error) { + debug("OSError at ${url}: ${error.toString()}"); + showServerError(url, L10().connectionRefused, error.toString()); + return null; } on CertificateException catch (error) { debug("CertificateException at ${url}:"); debug(error.toString());