Add error handling to autorun

c2e6593343b6360907839ab8ce348b3e70131e85

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -0Showing whitespace changes
server.js+4 -0
@@ -318,8 +318,12 @@ async function postSetupTasks(result) {
318 const autorunUrl = cliArgs.getAutorunUrl(autorunHostname);318 const autorunUrl = cliArgs.getAutorunUrl(autorunHostname);
319319
320 if (cliArgs.autorun) {320 if (cliArgs.autorun) {
321 try {
321 console.log('Launching in a browser...');322 console.log('Launching in a browser...');
322 await open(autorunUrl.toString());323 await open(autorunUrl.toString());
324 } catch (error) {
325 console.error('Failed to launch the browser. Open the URL manually.');
326 }
323 }327 }
324328
325 setWindowTitle('SillyTavern WebServer');329 setWindowTitle('SillyTavern WebServer');