Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Domain error handler not preventing exception from bubbling up when --abort-on-uncaught-exception used #8631

Closed
misterdjules opened this issue Oct 27, 2014 · 1 comment

Comments

@misterdjules
Copy link

When passing the --abort-on-uncaught-exception command line parameter to node, the top-level domain error handler does not prevent exception from bubbling up and making the process exit.

➜  node-0.10 git:(v0.10) ✗ cat test-domain-abort-on-uncaught.js 
var domain = require('domain');
var d = domain.create();

d.on('error', function() {
  // Swallowing the error on purpose, the goal is to reproduce
  // a bug when, even if there's a top level domain error handler
  // that swallows the error, the process exits because of the
  // original exception
});

d.run(function doStuff() {
  process.nextTick(function () {
    throw new Error("You should NOT see me");
  });
});
➜  node-0.10 git:(v0.10) ✗ ./node --version
v0.10.34-pre
➜  node-0.10 git:(v0.10) ✗ ./node test-domain-abort-on-uncaught.js 
➜  node-0.10 git:(v0.10) ✗ ./node --abort-on-uncaught-exception test-domain-abort-on-uncaught.js
Uncaught Error: You should NOT see me

FROM
/Users/JulienGilli/dev/node-0.10/test-domain-abort-on-uncaught.js:13:11
process._tickDomainCallback (node.js:463:13)
Function.Module.runMain (module.js:499:11)
startup (node.js:119:16)
node.js:906:3
[1]    60143 abort      ./node --abort-on-uncaught-exception test-domain-abort-on-uncaught.js
➜  node-0.10 git:(v0.10) ✗
@misterdjules misterdjules added this to the 0.10.34 milestone Oct 27, 2014
@misterdjules misterdjules self-assigned this Oct 30, 2014
misterdjules pushed a commit to misterdjules/node that referenced this issue Nov 3, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes nodejs#8631. Also fixes nodejs#8630.
misterdjules pushed a commit to misterdjules/node that referenced this issue Nov 3, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes nodejs#8631. Also fixes nodejs#8630.
misterdjules pushed a commit to misterdjules/node that referenced this issue Nov 3, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes nodejs#8631. Also fixes nodejs#8630.
misterdjules pushed a commit to misterdjules/node that referenced this issue Nov 3, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes nodejs#8631. Also fixes nodejs#8630.
misterdjules pushed a commit to misterdjules/node that referenced this issue Nov 18, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes nodejs#8631. Also fixes nodejs#8630.
misterdjules pushed a commit to misterdjules/node that referenced this issue Nov 19, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes nodejs#8631. Also fixes nodejs#8630.
misterdjules pushed a commit that referenced this issue Nov 19, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes: #8631
Fixes: #8630
PR-URL: #8666
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
@trevnorris
Copy link

Fixed by caeb677.

mscdex pushed a commit to mscdex/node that referenced this issue Dec 25, 2014
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes: nodejs#8631
Fixes: nodejs#8630
PR-URL: nodejs#8666
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants