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

Preferred method of handling server error #133

Closed
JakeDluhy opened this issue Jan 29, 2016 · 2 comments
Closed

Preferred method of handling server error #133

JakeDluhy opened this issue Jan 29, 2016 · 2 comments

Comments

@JakeDluhy
Copy link

We are using Ember Infinity for our infinite scrolling feed (loving it btw). One case we want to handle, however, is when there is a server error, and it returns a 404 JSON (or 500). We would like to gracefully fail, and show a message. I added a catch

return this.infinityModel('activity', params)
.catch(() => {

});

Which kind of works... I still get the error Uncaught Error: Property set failed: object in path "controller.model" could not be found or was destroyed. And the Loading Infinite Model... text is still displayed. I could ignore the error and have a class get rid of the text in this case, but I was wondering if there's a best way to handle this case. Thanks!

@JakeDluhy
Copy link
Author

I did a bit more researching, and discovered that Ember has some error handling options from the route's model hook. https://guides.emberjs.com/v2.3.0/routing/loading-and-error-substates/

I just defined an error template and went from there.

@hhff
Copy link
Collaborator

hhff commented Feb 2, 2016

nice!

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