Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process 'error' event is undocumented #36770

Closed
addaleax opened this issue Jan 4, 2021 · 9 comments
Closed

process 'error' event is undocumented #36770

addaleax opened this issue Jan 4, 2021 · 9 comments
Labels
doc Issues and PRs related to the documentations. eventtarget Issues and PRs related to the EventTarget implementation.

Comments

@addaleax
Copy link
Member

addaleax commented Jan 4, 2021

process.emit('error', err, event);
/cc @benjamingr

@addaleax addaleax added doc Issues and PRs related to the documentations. eventtarget Issues and PRs related to the EventTarget implementation. labels Jan 4, 2021
@benjamingr
Copy link
Member

I wonder if we want to keep it or emit uncaughtException directly since no-one actually complained about this or asked for this since EventEmitter was added.

We can also just doc it.

@benjamingr
Copy link
Member

Any strong opinions?

@addaleax
Copy link
Member Author

addaleax commented Jan 4, 2021

I was definitely caught by surprise by this being added, and would be happy to treat it as uncaught exceptions (i.e. act as if there’s no 'error' listener present).

@jasnell
Copy link
Member

jasnell commented Jan 4, 2021

What's the issue here? There is documentation for this: https://nodejs.org/dist/latest-v15.x/docs/api/events.html#events_eventtarget_error_handling

@addaleax
Copy link
Member Author

addaleax commented Jan 4, 2021

https://nodejs.org/api/process.html#process_process_events is missing them – we always document events on the emitter.

@benjamingr
Copy link
Member

@jasnell any strong opinions about making this an uncaughtException? I'm happy to make a PR.

@jasnell
Copy link
Member

jasnell commented Jan 6, 2021

About making what an uncaughtException? Sorry, it's not clear

@addaleax
Copy link
Member Author

addaleax commented Jan 7, 2021

@jasnell About making an exception inside a EventTarget event handler be treated like an uncaught exception, i.e. trigger the uncaughtException listener if there is one and otherwise exit the process with error code 1.

@Linkgoron
Copy link
Member

I'll try taking a stab at this

Linkgoron pushed a commit to Linkgoron/node that referenced this issue Feb 5, 2021
Change the behavior of EventTarget, instead of emitting
'error' on handler exception, emit 'uncaughtException'.

Fixes: nodejs#36770
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Feb 5, 2021
Change the behavior of EventTarget, instead of emitting
'error' on handler exception, emit 'uncaughtException'.

Fixes: nodejs#36770
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Feb 5, 2021
Change the behavior of EventTarget, instead of emitting
'error' on handler exception, emit 'uncaughtException'.

Fixes: nodejs#36770
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Feb 5, 2021
Change the behavior of EventTarget, instead of emitting
'error' on handler exception, emit 'uncaughtException'.

Fixes: nodejs#36770
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Feb 11, 2021
Change the behavior of EventTarget, instead of emitting
'error' on handler exception, emit 'uncaughtException'.

Fixes: nodejs#36770
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Feb 13, 2021
Change the behavior of EventTarget, instead of emitting
'error' on handler exception, emit 'uncaughtException'.

Fixes: nodejs#36770
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. eventtarget Issues and PRs related to the EventTarget implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants