meteor-mantra-kickstarter
meteor-mantra-kickstarter copied to clipboard
Setting LocalState messages in action Meteor.call not displaying
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 theMeteor.call
, it is. - If you comment out
return clearErrors
in the corresponding container, the error set inside theMeteor.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?
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.