Skip to content
Snippets Groups Projects
Commit ed50c8ba authored by Louis-Marie Michelin's avatar Louis-Marie Michelin
Browse files

fix(errorHandler): use error.stack instead of error.toString') to get more...

fix(errorHandler): use error.stack instead of error.toString') to get more details during development
parent 6e1fb637
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
const jsonErrorHandler = function (error, req, res, next) { const jsonErrorHandler = function (error, req, res, next) {
if (!res.headersSent) { if (!res.headersSent) {
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
res.status(500).json({ message: error.toString() }); res.status(500).json({ message: error.stack });
} else { } else {
// Hide error details in production to avoid security issues // Hide error details in production to avoid security issues
res.status(500).json({ message: "Internal server error" }); res.status(500).json({ message: "Internal server error" });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment