From 4b5a6854a04556c7432a100b1b6898361a53ba81 Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Tue, 13 Feb 2024 17:53:27 -0500 Subject: [PATCH] tolerate partial string desc fetches --- app-shell/src/system-info/usb-devices.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app-shell/src/system-info/usb-devices.ts b/app-shell/src/system-info/usb-devices.ts index 8bdae1ff8cb..7fd3ff11a7c 100644 --- a/app-shell/src/system-info/usb-devices.ts +++ b/app-shell/src/system-info/usb-devices.ts @@ -61,7 +61,14 @@ const orDefault = ( promise: Promise, defaulter: (err: any) => U ): Promise => - promise.then((result: T): T => result).catch((err: any) => defaulter(err)) + promise + .then((result: T): T => result) + .catch( + (err: any) => + new Promise(resolve => { + resolve(defaulter(err)) + }) + ) function upstreamDeviceFromUsbDevice(device: usb.Device): Promise { return new Promise((resolve, reject) => {