Skip to content

Commit 27d8518

Browse files
committed
feat: improve error handling within startCallback and endCallback
1 parent 8f66c22 commit 27d8518

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/Server.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,9 @@ class Server {
21752175
}
21762176

21772177
startCallback(callback) {
2178-
this.start().then(() => callback(null), callback);
2178+
this.start()
2179+
.then(() => callback(null), callback)
2180+
.catch(callback);
21792181
}
21802182

21812183
async stop() {
@@ -2235,7 +2237,9 @@ class Server {
22352237
}
22362238

22372239
stopCallback(callback) {
2238-
this.stop().then(() => callback(null), callback);
2240+
this.stop()
2241+
.then(() => callback(null), callback)
2242+
.catch(callback);
22392243
}
22402244

22412245
// TODO remove in the next major release

0 commit comments

Comments
 (0)