Skip to content

Commit

Permalink
Merge pull request #85 from built-on-openfin/dev/martyn/launch-handle…
Browse files Browse the repository at this point in the history
…-disconnect

Handle launch websocket disconnect
  • Loading branch information
obany authored Jan 12, 2024
2 parents dc908bf + acc2461 commit fe0d2b7
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 fe0d2b7

Please sign in to comment.