sách gpt4 ai đã đi

meteor - 在 Meteor 中,this.error 和在 Meteor.publish 中抛出新的 Meteor.Error 有什么区别?

In lại 作者:行者123 更新时间:2023-12-04 17:36:58 26 4
mua khóa gpt4 Nike

hiện hữu Meteor.publish ,sử dụng this.error 有什么区别并简单地抛出 Meteor.Error ?

1 Câu trả lời

this.error仅在发布方法内可用。每 the docs :

Stops this client's subscription, triggering a call on the client to the trênLỗi callback passed to Meteor.subscribe, if any. If error is not a Meteor.Error, it will be mapped to Meteor.Error(500, "Internal server error").



ném Meteor.Error不会停止客户端的订阅,它只会终止执行并引发异常。因此,如果您想确保 Meteor 会在您之后进行清理并允许您在发生意外情况时处理客户端上的错误,建议使用 this.error而不是在发布方法中扔你自己的。

关于meteor - 在 Meteor 中,this.error 和在 Meteor.publish 中抛出新的 Meteor.Error 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15511497/

26 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com