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

Deprecate error property #3560

Merged
merged 1 commit into from
Jul 24, 2015
Merged

Deprecate error property #3560

merged 1 commit into from
Jul 24, 2015

Conversation

tchak
Copy link
Member

@tchak tchak commented Jul 18, 2015

@bmac as discussed, here is the deprecation for error property

if (arguments.length === 2) {
this._error = error;
}
Ember.deprecate('DS.Model#error has been deprecated please use adapterError instead');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems pretty frequent and i imagine users will disable warnings altogether as their apps will get super noisy. We should probably deprecate once.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, I will update later tonight.

@tchak tchak force-pushed the deprecate-error branch 2 times, most recently from cd6acb1 to cdbac46 Compare July 18, 2015 18:23
@tchak
Copy link
Member Author

tchak commented Jul 18, 2015

@fivetanley updated for only show deprecation once

@tchak
Copy link
Member Author

tchak commented Jul 18, 2015

come on appveyor...

return Ember.get(this, 'adapterError');
}
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets just make this a normal computed property so it can be overridden. Part of the original reason for renaming error to adapterError was because people were defining an error attribute on their models. That should still be allowed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, but now that I am thinking, if someone defined error attribute on the model, the deprecation will not work anyway. Not sure what to do about it. Maybe it is double, but I have no idea how to define a property that can be overridden but will still run some code on get...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone defines an error attribute I don't think we should log the deprecation because presumably they want to use the error property as an attribute and are not accidentally trying to reference adapterError.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmac this is what I assumed. PR updated.

}
return Ember.get(this, 'adapterError');
}
}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this computed need a dependency on adapterError or should it be marked volatile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

off cours... Sorry for the mess with this thing. Should have been an easy one. Updated...

@bmac
Copy link
Member

bmac commented Jul 24, 2015

Tested and it works great. 👍

bmac added a commit that referenced this pull request Jul 24, 2015
@bmac bmac merged commit 2884e83 into emberjs:release Jul 24, 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

Successfully merging this pull request may close these issues.

None yet

3 participants