From 9bcddac14e0eff2448f648cd045d4e5a51d73b6d Mon Sep 17 00:00:00 2001 From: Tomas Martykan Date: Mon, 25 Nov 2024 14:08:45 +0100 Subject: [PATCH] fix(suite-desktop-core): don't fail hard if http-receiver port is occupied --- .../suite-desktop-core/src/modules/http-receiver.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/suite-desktop-core/src/modules/http-receiver.ts b/packages/suite-desktop-core/src/modules/http-receiver.ts index e3310fb7690..8297c25d858 100644 --- a/packages/suite-desktop-core/src/modules/http-receiver.ts +++ b/packages/suite-desktop-core/src/modules/http-receiver.ts @@ -65,9 +65,17 @@ export const initBackground: ModuleInitBackground = ({ mainWindowProxy, mainThre } logger.info(SERVICE_NAME, 'Starting server'); - await receiver.start(); - return receiver.getInfo(); + try { + await receiver.start(); + + return receiver.getInfo(); + } catch (error) { + // Don't fail hard if the server can't start + logger.error(SERVICE_NAME, 'Failed to start server: ' + error); + + return { url: null }; + } }; const onQuit = async () => {