mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Fix uncaught exceptions in net library (#10628)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
Added missing error event handler
This commit is contained in:
parent
719bc1a87f
commit
674defa1b1
|
|
@ -98,6 +98,9 @@ export class NetStream extends Streams.ReadWriteStream {
|
|||
response.on('data', data => {
|
||||
this.push(data);
|
||||
});
|
||||
response.on('error', error => {
|
||||
if (!this.atEOF) this.pushError(error, true);
|
||||
});
|
||||
response.on('end', () => {
|
||||
if (this.state === 'open') this.state = 'success';
|
||||
if (!this.atEOF) this.pushEnd();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user