Add error handling to autorun

This commit is contained in:
Cohee
2025-03-24 10:03:23 +00:00
parent be7750d6fd
commit c2e6593343

View File

@@ -318,8 +318,12 @@ async function postSetupTasks(result) {
const autorunUrl = cliArgs.getAutorunUrl(autorunHostname); const autorunUrl = cliArgs.getAutorunUrl(autorunHostname);
if (cliArgs.autorun) { if (cliArgs.autorun) {
console.log('Launching in a browser...'); try {
await open(autorunUrl.toString()); console.log('Launching in a browser...');
await open(autorunUrl.toString());
} catch (error) {
console.error('Failed to launch the browser. Open the URL manually.');
}
} }
setWindowTitle('SillyTavern WebServer'); setWindowTitle('SillyTavern WebServer');