We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 00835d8 + 9c60d32 commit b938b8dCopy full SHA for b938b8d
index.js
@@ -63,20 +63,18 @@ function createExitHarness (conf) {
63
64
if (conf.exit === false) return harness;
65
if (!canEmitExit || !canExit) return harness;
66
-
67
- var _error;
68
69
- process.on('uncaughtException', function (err) {
70
- if (err && err.code === 'EPIPE' && err.errno === 'EPIPE'
71
- && err.syscall === 'write') return;
72
73
- _error = err
74
75
- throw err
76
- })
+ var inErrorState = false;
+
+ var $_fatalException = process._fatalException
+ process._fatalException = function fakeFatalException() {
+ inErrorState = true;
+ $_fatalException.apply(this, arguments)
+ }
77
78
process.on('exit', function (code) {
79
- if (_error) {
+ // let the process exit cleanly.
+ if (inErrorState) {
80
return
81
}
82
0 commit comments