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

catch errors event #30

Open
abelrgr opened this issue Feb 7, 2017 · 2 comments
Open

catch errors event #30

abelrgr opened this issue Feb 7, 2017 · 2 comments

Comments

@abelrgr
Copy link

abelrgr commented Feb 7, 2017

When I was trying to compile the template without the friends array (because data is dynamic):

<h1>{{name.first}} {{name.last}}</h1>
<ul>
   {{:each @friends do}}
   <li>{{name}}</li>
   {{end}}
</ul>

I get this message:

TypeError: Cannot set property '$index' of undefined at walrus.js:1125:24

There is any way to catch the errors to send over the rest server to show an error into the frontend?

I'm working over nodejs 7.x.
BTW the other stuff works really great!

@jeremyruppel
Copy link
Owner

I'm sure there's a way to handle this error better! What would you prefer walrus do in this case? Should it simply ignore the :each block if the @friends array isn't present?

@abelrgr
Copy link
Author

abelrgr commented Feb 8, 2017

@jeremyruppel thanks for your answer :) , yeah, it should be better if the block is ignored if the block @friends is not present.

BTW, Walrus better than others in nodejs

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