Skip to content
代码片段 群组 项目
提交 b48ba02a 编辑于 作者: Jing Teng's avatar Jing Teng 提交者: Timotej Ecimovic
浏览文件

respond with error message properly

JSON.stringify() does not handle "Error" class properly and just returns a blank {}
上级 c37ca743
No related branches found
No related tags found
无相关合并请求
......@@ -129,7 +129,9 @@ function httpPostCluster(db) {
})
.send()
} catch (err) {
response.status(StatusCodes.INTERNAL_SERVER_ERROR).json(err)
response
.status(StatusCodes.INTERNAL_SERVER_ERROR)
.json({ message: err.message, stack: err.stack })
}
}
}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册