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

how to handle server error 500 on Model.find? #134

Open
ghost opened this issue Jun 6, 2014 · 0 comments
Open

how to handle server error 500 on Model.find? #134

ghost opened this issue Jun 6, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 6, 2014

I'm trying to handle error 500 failures and I can't figure out how to prevent the rest adapter from choking. I've extended the PayloadSerializer to check the status code on the xhr and return something different if the code is 500, but I have no idea what to return to keep from hitting an internal assertion. Ideally, I'd just handle it in $(document).ajaxError, but the request never seems to bubble up to there.

Instead, execution just stops with this stack trace:

GET http://localhost:3000/slots 500 (Internal Server Error) jquery.js?body=1:9667
Error: Assertion Failed: Cannot call get with 'typeKey' on an undefined object.
    at new Error (native)
    at Error.Ember.Error (http://localhost:3000/assets/ember.js?body=1:911:19)
    at Object.Ember.assert (http://localhost:3000/assets/ember.js?body=1:74:11)
    at get (http://localhost:3000/assets/ember.js?body=1:2169:9)
    at require.define.Ep.IdManager.Ember.Object.extend._generateClientId (http://localhost:3000/assets/epf_a06b0350.js?body=1:4241:16)
    at require.define.Ep.IdManager.Ember.Object.extend.reifyClientId (http://localhost:3000/assets/epf_a06b0350.js?body=1:4229:29)
    at require.define.Ep.Session.Ember.Object.extend.reifyClientId (http://localhost:3000/assets/epf_a06b0350.js?body=1:2095:24)
    at require.define.Ep.Session.reopen.merge (http://localhost:3000/assets/epf_a06b0350.js?body=1:1767:14)
    at merge (http://localhost:3000/assets/epf_a06b0350.js?body=1:280:28)
    at http://localhost:3000/assets/epf_a06b0350.js?body=1:286:17 ember.js?body=1:3522
Uncaught Error: Assertion Failed: Error: Assertion Failed: Cannot call get with 'typeKey' on an undefined object. ember.js?body=1:74

Any hints about what I can return would be very welcome. Thanks.

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

0 participants