如何在操作钩子中返回错误?
用例是在保存新模型实例后发送推送通知。
我观察'after save'
事件,发送推送。如果由于某种原因失败,我想发送一个500 response
代码。我怎么做?
我无法找到关于该ctx
对象实际是什么或包含什么的文档。
Customer.observe('after save', function(ctx, next) {
//model saved, but sending push failed for whatever reason, and I want to now send a 500 error back to the user
//how? what's inside ctx? how do you send back a response?
next();
});
谢谢