respect environment is development on error message
This commit is contained in:
@@ -142,7 +142,7 @@ app.use(require("./routes/eventsheet").router)
|
|||||||
app.use(function (err, req, res, next) {
|
app.use(function (err, req, res, next) {
|
||||||
// set locals, only providing error in development
|
// set locals, only providing error in development
|
||||||
if (err) {
|
if (err) {
|
||||||
res.locals.message = err.message;
|
res.locals.message = req.app.get("env") === "development" ? err.message : "An error has occurred";
|
||||||
res.locals.error = req.app.get("env") === "development" ? err : {};
|
res.locals.error = req.app.get("env") === "development" ? err : {};
|
||||||
if (typeof err === 'string' || err instanceof String) {
|
if (typeof err === 'string' || err instanceof String) {
|
||||||
err = {
|
err = {
|
||||||
|
|||||||
Reference in New Issue
Block a user