How to handle 404 of Ember Data in route?
ember-data, ember.js
Solution
Bad news: right now, ember-data doesn't do anything when it gets a 404 on find(). At all. The model sits in the 'loading' state forever.
There are no non-completely-stupid options, here, in my opinion. What I would probably do as a last resort is add a `notFound` attribute on my DS.Model, and instead of returning 404, return JSON with `notFound` set to `true`. It's painful, I know...
--- I had originally offered a solution of overriding `find` in a subclass of `RESTAdapter`. Then I noticed that `find` DOES NOT get passed the record instance it is supposedly loading. So, no go on handling 404s by putting the record into an error state.
[NOTE: ember-data has changed dramatically since March 2013, the information in this answer may no longer be operative]
Problem
In my route I have a method that tries to request a list of models from the server ``` model: -> App.MyModel.find projectId: (@modelFor "project").id ``` Now obviously sometimes this might return a 404. At the moment when this happens, Ember just stops doing anything. No view is rendered, no controller is setup. So how can I properly handle the 404 (ie show an error view)?