javascript - Catching Errors in Meteor Iron-Router Route waitOn Function -


I have a meteor published work, and I'm throwing that function in an error to be caught by the customer. I am using an iron-router, and I am subscribing to the publication in the 'wait-on' function. For some reason, my error function is not being called when I remove the error from the publication, and I'm not sure why

  this.route ( 'AssignmentsList', {path: '/ groups /: groupId', waitOn: function () {error on error, error, result} {console.log (called "onrrofunction"); If (error) {console .log ("Error!"); Warning (error.reason);}}; Return [Meteor.subscribe ('AssignmentBridgeGroup', this .pursum groupId, onErrorfunction), Meteor.subscribe ("Groups Iaiaidi ", this.params.groupId)]}}, data: function () {return {GroupId: ThiskparamskgroupId}}});  

And here's my publication:

  Meteor.publish ("Assignment Biz Group", Function (Group ID) {try {if (_ .findOne ({_ Id: groupId}) member, this.userId {return Assignments.find ({group: groupId});} else {var errorToThrow = new Meteor.Error (401, "Access denied: you can not see when As long as you are not a member of this group, assignment. "); Terror (erritrofro);}} catch (mistake) {this.error (err);}});  

This issue was my Honor Callback syntax. I passed a function to the subscription method, which is explained in the form of an honorary function, only when it is called .ready () in the published function. I changed the Meteor.subscribe ('assignmentsByGroup', this.params.groupId, onRrofunction) to Meteor.subscribe ('assignmentsByGroup', this.params.groupId, {onError: onErrorfunction}) and it worked! Apart from this, you can still make an effort and time to capture in the published function; The error is still thrown correctly or without it, but with it you can also catch other internal server errors.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -