JavaScript Node.js Basics Handling Errors in Node Handling the Error Event in Node

Ellis Corio
Ellis Corio
13,630 Points

can anyone tell me what is wrong with this error handler?

request.on('error', error => console.error(Problem with request: ${error.message}));

Ellis Corio
Ellis Corio
13,630 Points

the back ticks are there they just dont want to copy for some reason

3 Answers

Chris Jones
Chris Jones
Java Web Development Techdegree Graduate 22,968 Points

Are you getting any output when the program runs? Or is the error handler just not being executed?

Ellis Corio
Ellis Corio
13,630 Points

i am getting an out put yes:

but it s the same message i would be getting without the error handler

Ellis Corio
Ellis Corio
13,630 Points

i actually went into the next workspace where the teacher had left his finished code, i copy/pasted and over wrote my own code, was pretty much identical anyway, and still........the error handlers do not seem to work