Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting LocalState messages in action Meteor.call not displaying #47

Open
solace opened this issue Apr 15, 2016 · 1 comment
Open

Setting LocalState messages in action Meteor.call not displaying #47

solace opened this issue Apr 15, 2016 · 1 comment

Comments

@solace
Copy link

solace commented Apr 15, 2016

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?

@martinhbramwell
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants