Skip to content

Commit 760aedd

Browse files
committed
throw error instead of just logging
1 parent 14067a1 commit 760aedd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ for (let i = 0; i < process.argv.length; i++) {
135135
}
136136
}
137137

138-
devServer(options);
138+
devServer(options).catch(e => {
139+
console.error(e.message);
140+
process.exit(1);
141+
});
139142

140143
// Needed for posix systems when used with npm-run-all.
141144
process.on('SIGTERM', () => {

lib/dev-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function devServer(options) {
5454

5555
if (options.https) {
5656
if (!(options.key && options.cert)) {
57-
console.log('Usage of --https requires --cert and --key to be set.')
57+
throw new Error('Usage of https requires cert and key to be set.')
5858
}
5959
const key = fs.readFileSync(options.key)
6060
const cert = fs.readFileSync(options.cert)

0 commit comments

Comments
 (0)