Skip to content

Commit c51b75e

Browse files
authored
fix(js_run_devserver): do not output run--watch EXIT errors by default (#2326)
When the process is terminated with something such as cmd-c it is very common the process will not finish sending/receiving the full EXIT message from the CLI so we shouldn't spam stdout. ### Changes are visible to end-users: no ### Test plan - Manual testing; please provide instructions so we can reproduce: `aspect run --watch` on a `js_run_devserver` target such as webpack/rspack, cmd-c and ensure no error is outputted
1 parent 2580e43 commit c51b75e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

js/private/js_run_devserver.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,20 @@ class AspectWatchProtocol {
796796

797797
async disconnect() {
798798
if (this.connection.writable) {
799-
await this._send('EXIT')
799+
try {
800+
await this._send('EXIT')
801+
} catch (e) {
802+
if (JS_BINARY__LOG_DEBUG) {
803+
console.log(
804+
'AspectWatchProtocol[disconnect]: failed to send EXIT message:',
805+
e
806+
)
807+
}
808+
}
809+
800810
await new Promise((resolve) => this.connection.end(resolve))
811+
812+
this.connection.destroy()
801813
}
802814

803815
return this

0 commit comments

Comments
 (0)