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

Model attribute named 'error' causes exception #3449

Closed
ZebraFlesh opened this issue Jun 25, 2015 · 5 comments
Closed

Model attribute named 'error' causes exception #3449

ZebraFlesh opened this issue Jun 25, 2015 · 5 comments

Comments

@ZebraFlesh
Copy link

Given the following model definition:

import DS from 'ember-data';

export default DS.Model.extend({
  state: DS.attr('string'),
  error: DS.attr('string'),
  progress: DS.attr('number'),
  complete: DS.attr('boolean', {defaultValue: false}),
  canceling: DS.attr('boolean', {defaultValue: false})
});

I encountered the following exception when upgrading from ember-data 1.0.0-beta-19.1 to 1.13.4:

Error: Attempted to handle event 'didSetProperty' on <task-status:16> while in state root.loading. Called with {name: error, oldValue: undefined, originalValue: undefined, value: null}.
    at new Error (native)
    at Error.EmberError (http://localhost:4200/assets/vendor.js:25661:21)
    at InternalModel.ember$data$lib$system$model$internal$model$$InternalModel._unhandledEvent (http://localhost:4200/assets/vendor.js:80504:15)
    at InternalModel.ember$data$lib$system$model$internal$model$$InternalModel.send (http://localhost:4200/assets/vendor.js:80381:16)
    at ember$new$computed$lib$main$$default.set (http://localhost:4200/assets/vendor.js:83921:33)
    at Descriptor.computedPropertySet [as _set] (http://localhost:4200/assets/vendor.js:23967:20)
    at Descriptor.computedPropertySetWithSuspend [as set] (http://localhost:4200/assets/vendor.js:23933:12)
    at new Class (http://localhost:4200/assets/vendor.js:46723:20)
    at Function.ClassMixinProps.create (http://localhost:4200/assets/vendor.js:47181:14)
    at InternalModel.ember$data$lib$system$model$internal$model$$InternalModel.materializeRecord (http://localhost:4200/assets/vendor.js:80194:33)

Once I renamed my model's "error" attribute to "errorMsg", the exception no longer occurred.

@visoft
Copy link

visoft commented Jul 2, 2015

I'm seeing the same problem.

@bmac
Copy link
Member

bmac commented Jul 2, 2015

I'm surprised this error started occurring with "1.13.4". Ember Data has had an error property on DS.Model for a long time. @tchak any idea whats going on here?

@tchak
Copy link
Member

tchak commented Jul 3, 2015

@bmac no it have not... It is a new one. Maybe it was a bad idea. I am not exactly sure what would be the right thing to do here.

tchak added a commit to tchak/data that referenced this issue Jul 12, 2015
@kenips
Copy link

kenips commented Jul 14, 2015

@tchak oh sorry didn't see your commit above.

@bmac bmac closed this as completed in 687fc9f Jul 17, 2015
bmac pushed a commit that referenced this issue Jul 17, 2015
jcope2013 pushed a commit to jcope2013/data that referenced this issue Aug 3, 2015
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

6 participants