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 request: onError action #14

Open
skarger opened this issue Dec 6, 2018 · 1 comment
Open

Feature request: onError action #14

skarger opened this issue Dec 6, 2018 · 1 comment

Comments

@skarger
Copy link

skarger commented Dec 6, 2018

An error that comes up sometimes when defining Exclaim UIs is a $bind referencing a key that does not exist in the given env.

For example, if your declared UI is the following:

        {
          ui: {
            $input: {
              $bind: 'non_existent.some_key',
            },
          },
        };

If you pass an env to {{exclaim-ui}} that does not include non_existent, then there will be an error when the end-user fills in the rendered <input>.

EmberError {stack: "Error: Property set failed: object in path "__env_…t http://localhost:4200/assets/vendor.js:38818:45", description: undefined, fileName: undefined, lineNumber: undefined, message: "Property set failed: object in path "__env__.non_existent" could not be found or was destroyed.", …}

While there may be other ways to mitigate this, the solution proposed here is for {exclaim-ui}} to expose an onError property.

It would be called with at least the raised Error. Maybe there are other useful params too.

Then client code can do something appropriate when that happens, such as rendering a more instructional message in its own UI.

@deverstalmage
Copy link
Contributor

This is a great idea- I'll try tackling this next time I have an open Friday

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

2 participants