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

[FEATURE] Adds a buildError hook #2832

Merged
merged 1 commit into from
Dec 24, 2014
Merged

[FEATURE] Adds a buildError hook #2832

merged 1 commit into from
Dec 24, 2014

Conversation

danmcclain
Copy link
Contributor

buildError hook will be called on when an error occurs during the
preBuild or postBuild hooks for addons, or when builder#build
fails

/cc @rwjblue

@rwjblue
Copy link
Member

rwjblue commented Dec 24, 2014

👍

@rwjblue
Copy link
Member

rwjblue commented Dec 24, 2014

/cc @rondale-sc

@danmcclain
Copy link
Contributor Author

@rwjblue Updated to assert the error thrown is the one received

@rondale-sc
Copy link
Contributor

OOoh, fancy! Awesome stuff! Going to integrate with ember-cli-rails-addon asap. :))

.then(this.processAddonBuildSteps.bind(this, 'postBuild'));
.then(this.processAddonBuildSteps.bind(this, 'postBuild'))
.catch(function(error) {
self.processAddonBuildSteps('buildError', error);
Copy link
Contributor

Choose a reason for hiding this comment

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

our convention is to use bind over self+closure like above

Copy link
Member

Choose a reason for hiding this comment

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

We need to use the closure here to return the original error.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is not happening, the only closed over var is self.

`buildError` hook will be called on when an error occurs during the
`preBuild` or `postBuild` hooks for addons, or when `builder#build`
fails
@danmcclain
Copy link
Contributor Author

Updated to use bind in for the closure scope, throws instead of Promise.reject (I thought it failed locally with throw, but it is fine with throw)

/cc @stefanpenner @rwjblue

rwjblue added a commit that referenced this pull request Dec 24, 2014
[FEATURE] Adds a buildError hook
@rwjblue rwjblue merged commit ffd52b5 into ember-cli:master Dec 24, 2014
@danmcclain danmcclain deleted the buildError branch December 26, 2014 16:42
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.

4 participants