【发布时间】:2015-10-29 18:03:42
【问题描述】:
我试图在繁荣内部错误对象的响应中返回错误对象,但它一直省略错误对象。 我尝试关注here 的答案,但没有帮助。
function (request, reply) {
options.healthCheck(function (err) {
if (!err) {
return reply('I\'m healthy!!!');
}
var boomErr = boom.internal('I don\'t feel so good', {
err: err
});
boomErr.output.payload.details = err;
return reply(boomErr);
});
}
回复如下:
{
"statusCode":500,
"error":"Internal Server Error",
"message":"An internal server error occurred",
"details":{ }
}
【问题讨论】:
标签: javascript node.js hapijs