From c1034ddea6079cffe133ac3a0c81ed5e7b4b4535 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 26 Nov 2024 14:36:04 -0800 Subject: [PATCH] Get connectToSerialPort to rethrow its serial port opening error to hopefully improve error message generation on linux - Changed error handling in `connectToSerialport.js` to throw exceptions instead of returning null on failure. --- src/renderer/utils/connectToSerialport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/utils/connectToSerialport.js b/src/renderer/utils/connectToSerialport.js index 3cee2e9fa..38336357e 100644 --- a/src/renderer/utils/connectToSerialport.js +++ b/src/renderer/utils/connectToSerialport.js @@ -126,6 +126,6 @@ export const connectToSerialport = async (targetVid, targetPid) => { return focus; } catch (e) { logger.error("Failed to open serial port", e); - return null; + throw e; } };