meteor-mantra-kickstarter icon indicating copy to clipboard operation
meteor-mantra-kickstarter copied to clipboard

Setting LocalState messages in action Meteor.call not displaying

Open solace opened this issue 8 years ago • 1 comments

Hi,

Not sure if I'm mistaken about this, but take the comments module for example.

action/comments.js sets LocalState for errors in both the Meteor.call for posts.createComment as well as outside the Meteor.call.

  • If you throw an error in the server-side action for posts.createComment, the error isn't displayed.
  • If you throw an error in action/comments.js before the Meteor.call, it is.
  • If you comment out return clearErrors in the corresponding container, the error set inside the Meteor.call callback is displayed, but is not cleared when you navigate to another page and then come back, it will only disappear if you hard reload.

Would this be because Meteor.call is asynchronous? What would be the best way of handling error (and success) messages set in the Meteor.call callback?

solace avatar Apr 15 '16 13:04 solace

I would also like to know the correct way to handle trapping server-side errors.

In terms of ergonomics users should never see server-side error messages, of course, but during development it's handy.

However, with the problem you describe, server-side errors don't appear in the server logs, yet get eaten by the failed display on the client.

martinhbramwell avatar Jul 04 '16 10:07 martinhbramwell