fix: improve error handling for network connection launch failures
This commit is contained in:
1 parent
623559cf8e
commit
f9b38ec9eb
1 file changed
+13
-2
@@ -521,14 +521,25 @@
|
|||||||
|
|
||||||
launching.set(false);
|
launching.set(false);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
launchError = err as Error;
|
const error = err as Error;
|
||||||
console.log(err);
|
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...', {
|
toast.error('Hmmm...', {
|
||||||
description: 'Failed to launch.',
|
description: 'Failed to launch.',
|
||||||
});
|
});
|
||||||
launching.set(false);
|
launching.set(false);
|
||||||
if ($trackingEnabled) umami.track('app_launch_fail', { error: err });
|
if ($trackingEnabled) umami.track('app_launch_fail', { error: err });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
|||||||
Reference in new issue
Block a user