Skip to content

Commit

Permalink
Ignore network errors when closing JSDOM collector
Browse files Browse the repository at this point in the history
Fix #203
  • Loading branch information
molant committed May 17, 2017
1 parent 758cb3c commit 343dc7c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib/collectors/jsdom/jsdom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,15 @@ class JSDOMCollector implements ICollector {
}

public close() {
this._window.close();
try {
this._window.close();
} catch (e) {
// We could have some pending network requests and this could fail.
// Because the process is going to end so we don't care if this fails.
// https://github.com/MicrosoftEdge/Sonar/issues/203
debug(`Exception ignored while closing JSDOM collector (most likely pending network requests)`);
debug(e);
}

return Promise.resolve();
}
Expand Down

0 comments on commit 343dc7c

Please sign in to comment.