Skip to content

Commit

Permalink
Merge pull request #805 from tricknotes/improve-error-message
Browse files Browse the repository at this point in the history
Improve error message
  • Loading branch information
stefanpenner committed Mar 17, 2013
2 parents 398edf3 + a21bd02 commit 830420a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ember-data/lib/adapters/fixture_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ require("ember-data/core");
require("ember-data/system/adapter");
require('ember-data/serializers/fixture_serializer');

var get = Ember.get, fmt = Ember.String.fmt;
var get = Ember.get, fmt = Ember.String.fmt,
dump = Ember.get(window, 'JSON.stringify') || function(object) { return object.toString(); };

/**
`DS.FixtureAdapter` is an adapter that loads records from memory.
Expand Down Expand Up @@ -30,7 +31,7 @@ DS.FixtureAdapter = DS.Adapter.extend({
var fixtures = Ember.A(type.FIXTURES);
return fixtures.map(function(fixture){
if(!fixture.id){
throw new Error(fmt('the id property must be defined for fixture %@', [fixture]));
throw new Error(fmt('the id property must be defined for fixture %@', [dump(fixture)]));
}
fixture.id = fixture.id + '';
return fixture;
Expand Down

0 comments on commit 830420a

Please sign in to comment.