Skip to content

Commit 8129ddb

Browse files
#1231: Fix unhandled promise rejection on server.open
1 parent 7050836 commit 8129ddb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/live-server/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,17 @@ LiveServer.start = function(options) {
368368
// Launch browser
369369
if (openPath !== null)
370370
if (typeof openPath === 'object') {
371-
openPath.forEach(p => open(openURL + p, { app: browser }));
371+
openPath.forEach(p =>
372+
open(openURL + p, { app: browser }).catch(() =>
373+
console.log(
374+
'Warning: Could not open pattern lab in default browser.'
375+
)
376+
)
377+
);
372378
} else {
373-
open(openURL + openPath, { app: browser });
379+
open(openURL + openPath, { app: browser }).catch(() =>
380+
console.log('Warning: Could not open pattern lab in default browser.')
381+
);
374382
}
375383
});
376384

0 commit comments

Comments
 (0)