Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJoseph Bertino
Full Stack JavaScript Techdegree Student 14,652 Points@ 4:21, what does Guil mean by "the given message"?
@ 4:21 in this video, we are instructed to "set the error message to the given message." What is the given message in this case? Is it res.message
or req.message
?
1 Answer
Brian Wright
6,770 PointsWhen an error is thrown, it will be passed as the err object in the global error handler app.use((err, req, res,next)). One of the properties of err object is err.message. This is the same as when you create an error with 'new Error("Error message here")'. In either of these cases, these will be what is described as the given error message.