Skip to content
Snippets Groups Projects
Commit 1c42e9f3 authored by Jonas Zohren's avatar Jonas Zohren :speech_balloon:
Browse files

More graceful error handling

parent 6fea5c3a
No related branches found
No related tags found
No related merge requests found
Pipeline #8014 passed with warnings
......@@ -87,8 +87,7 @@ async function handleAttachToRoom({
// Crash if attaching to room was not successful
console.error(error);
process.send({ eventName: "attachToError", data: error.toString() });
await sleep(100);
process.exit(1);
await killMe(1);
}
}
......@@ -138,12 +137,23 @@ async function handleSendMessage({ content }) {
}
async function handleDetach() {
clearInterval(screenShotInterval);
clearInterval(gatherUserInfoInterval);
await roomPage.close();
await killMe(0);
}
async function killMe(exitCode) {
try {
clearInterval(screenShotInterval);
} catch (error) {}
try {
clearInterval(gatherUserInfoInterval);
} catch (error) {}
try {
await roomPage.close();
} catch (error) {}
try {
await fs.promises.unlink(roomScreenShotPath);
} catch (error) {}
process.send({ eventName: "detachSuccess", data: null });
await sleep(100);
process.exit(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment