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

[BUGFIX beta] Provide a helpful error for undefined closure actions. #12241

Merged

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 30, 2015

In the following scenario:

{{#foo-bar blah=(action somethingThatIsUndefined)}}
  Click Me!
{{/foo-bar}}

Previously, an error was only thrown when attempting to invoke this.attrs.blah(). After this change a helpful error like the following will be thrown:

An action could not be made for `somethingThatIsUndefined` in
< component object id>.  Please confirm that you are using either
a quoted action name (i.e. `(action 'somethingThatIsUndefined')`)
or a function available in < component object id>.

Fixes #12240.

@rwjblue rwjblue force-pushed the better-error-for-unknown-closure-actions branch 2 times, most recently from 49a3ec7 to 53099c6 Compare August 30, 2015 00:34
@locks
Copy link
Contributor

locks commented Aug 30, 2015

I was bitten by this earlier, this change makes the problem much clearer by moving it to the declaration phase vs invocation.

In the following scenario:

```handlebars
{{#foo-bar blah=(action somethingThatIsUndefined)}}
  Click Me!
{{/foo-bar}}
```

Previously, an error was only thrown when attempting to invoke
`this.attrs.blah()`.  After this change a helpful error like the following
will be thrown:

```
An action could not be made for `somethingThatIsUndefined` in
< component object id>.  Please confirm that you are using either
a quoted action name (i.e. `(action 'somethingThatIsUndefined')`)
or a function available in < component object id>.
```
@rwjblue rwjblue force-pushed the better-error-for-unknown-closure-actions branch from 53099c6 to eb01971 Compare August 30, 2015 00:48
rwjblue added a commit that referenced this pull request Aug 30, 2015
…re-actions

[BUGFIX beta] Provide a helpful error for undefined closure actions.
@rwjblue rwjblue merged commit f60b3a6 into emberjs:master Aug 30, 2015
@rwjblue rwjblue deleted the better-error-for-unknown-closure-actions branch August 30, 2015 01: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.

2 participants