fix: improve error handling for network connection launch failures

This commit is contained in:
2026-01-04 20:20:19 +01:00
parent 623559cf8e
commit f9b38ec9eb
+18 -7
View File
@@ -521,13 +521,24 @@
launching.set(false);
} catch (err) {
launchError = err as Error;
console.log(err);
toast.error('Hmmm...', {
description: 'Failed to launch.',
});
launching.set(false);
if ($trackingEnabled) umami.track('app_launch_fail', { error: err });
const error = err as Error;
if (error.name === 'AbortError') {
toast.error('Hmmm...', {
description: 'Failed to launch.',
});
launching.set(false);
launchError = {
name: error.name,
message: 'Network request connection timed out.',
};
} else {
launchError = error;
toast.error('Hmmm...', {
description: 'Failed to launch.',
});
launching.set(false);
if ($trackingEnabled) umami.track('app_launch_fail', { error: err });
}
}
};