Skip to content

Commit

Permalink
Handle launch websocket disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
obany committed Jan 12, 2024
1 parent dc908bf commit acc2461
Show file tree
Hide file tree
Showing 19 changed files with 133 additions and 19 deletions.
8 changes: 7 additions & 1 deletion how-to/container-platform-starter/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/create-window/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/integration-excel/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-content-creation-rules/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-dynamic-manifest/basic/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-launch-external-process/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-logging-apis/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-popup-window/advanced/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-popup-window/modal/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-popup-window/multiple-results/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-popup-window/single-result/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-preloads/basic/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-preloads/restart-on-refresh/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-security-realms/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down
8 changes: 7 additions & 1 deletion how-to/use-window-options/scripts/launch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ async function run(manifestUrl) {
await platform.quit();
}
} catch (err) {
console.error(err);
if (err.toString().includes('no longer connected')) {
console.log('Platform no longer connected');
console.log('Exiting process');
process.exit();
} else {
console.error(err);
}
}
};
console.log(`Wrapped target platform: ${manifest.platform.uuid}`);
Expand Down

0 comments on commit acc2461

Please sign in to comment.