-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Line 28 in 543acb9
| app.use((err, req, res, next) => { |
If that error ever gets thrown in production i will have no way of knowing what went wrong.
you need to log your errors somewhere, you can stringify an error object and store it in database, or in a txt file which is really a bad way of doing it.
for now just add a console.log(err) so you can at least reproduce the issue and see the error, but in serious production projects you will probably need to log the error somewhere.
I prefer to stringify the following object and put it somewhere
{
date: new Date(),
error: err.stack,
url: req.url
ip: req.ip // if your project does stuff based on region this might be useful, but usually is not
really necessary
}Metadata
Metadata
Assignees
Labels
No labels