Node.js · Middle · Question 21 of 75

What happens if an EventEmitter emits error and there is no error listener?

Explanation

The error event is special. Always add an error listener to streams, sockets and servers, or use pipeline and events.once, which turn it into a rejection.

Further reading

Problem with a question

Node.js · Middle · question 21

Test yourself

Take the Node.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz