Repository navigation
Allow registering multiple uncaught exception capture callbacks #23348
Description
Activity
- addeddomainIssues and PRs related to the domain subsystem.Issues and PRs related to the domain subsystem.
on Oct 9, 2018 - addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Oct 9, 2018 Makes a sense to me as long as no major perf overhead.
I'd be 👍 for such update.
Also, we could update the domain's callback to accept to call other ones after itself but this might get pretty confusing.
@mhdawson I think perf impact would only happen when there is an uncaught exception, which should be rare in theory
Submitted a proof-of-concept PR at #24279. @vdeturckheim @mhdawson I would be grateful if you had the time to give me some feedback on that :)
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Feb 28, 2022 There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.
Is your feature request related to a problem? Please describe.
While experimenting with building a user-land alternative to the core
domainmodule, I realized that the fact that one can only set one uncaught exception callback makes it more difficult than it could be.Basically, the problem is that it is not possible to have two different implementations of a "domain-like" module loaded at the same time in a given process. For instance, it is currently not possible to load the user-land
domainemodule along with the coredomainmodule.This makes it difficult for applications to start adopting user-land alternatives to
domain: in the current state, they (and all their dependencies) either need to adopt one single user-land alternative, or stick with thecoredomain module.A good example is when I ported restify to use this new
domainemodule instead of the coredomainmodule. I had to portnode-tap(which is used to run restify's tests) to use that newdomainemodule as well.Another example is the fact that one cannot use a user-land domain-like module from within the core repl because it requires
domain.This is something that I started discussing with @addaleax but that I thought would benefit from being presented to a broader set of people to gather initial feedback, comments and suggestions.
Describe the solution you'd like
The fundamental change would be to allow multiple uncaught exception callbacks to be registered.
I haven't thought too much about the design or the implementation details of a specific solution. I'd first like to gather feedback on whether people would be open to allowing multiple callbacks to be registered.
Describe alternatives you've considered
The only alternative to having this feature available that I can see for now is to require applications to migrate their code and all their dependencies to any user-land domain module that they choose to use.
Looking forward to reading your thoughts!
/cc @addaleax @vdeturckheim @nodejs/domains