Handle ECONNRESET error in SimpleServer
The ECONNRESET error is allowed to happen. We should handle it gracefully to not report travis builds as broken.
This commit is contained in:
parent
da0cde1b45
commit
f23f72524e
@ -120,6 +120,12 @@ class SimpleServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onRequest(request, response) {
|
_onRequest(request, response) {
|
||||||
|
request.on('error', error => {
|
||||||
|
if (error.code === 'ECONNRESET')
|
||||||
|
response.end();
|
||||||
|
else
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
let pathName = url.parse(request.url).path;
|
let pathName = url.parse(request.url).path;
|
||||||
// Notify request subscriber.
|
// Notify request subscriber.
|
||||||
if (this._requestSubscribers.has(pathName))
|
if (this._requestSubscribers.has(pathName))
|
||||||
|
Loading…
Reference in New Issue
Block a user