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

Binding error in value converter causes view not to load and does not report error. #278

Closed
ghost opened this issue Jan 6, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Jan 6, 2016

ANY error in value converter will result in the view not loading and no errors appear in the console. Effectively swallowing the error. Developer debug experience is poor since even a typo will result in an error that can't be located.

To Repro:

Take any binding that has a converter that has one parameter, just pass: BOGUS as below, the view won’t load.

${myModelProperty | myConverter:BOGUS }

Thanks,

Karl

@EisenbergEffect
Copy link
Contributor

@jdanyow Important note about this that it's not the BOGUS symbol in the expression that is causing the problem. It's the fact that the myConverter converter attempts to use a parameter which is undefined, resulting in an error inside the toView method of the converter. We probably need some way to ensure that any errors that occur inside converters are logged.

@jdanyow
Copy link
Contributor

jdanyow commented Jan 6, 2016

I'm seeing an error in the console here: http://plnkr.co/edit/oHcQSk?p=preview

Will test with the router.

@ghost
Copy link
Author

ghost commented Jan 6, 2016

Strange.

This was my scenario that caused the problem, the 1st parameter BOGUS. Now
it's not.

HI

${message | error:BOGUS}

On Wed, Jan 6, 2016 at 12:24 PM, Jeremy Danyow [email protected]
wrote:

I'm seeing an error in the console here:
http://plnkr.co/edit/oHcQSk?p=preview

Will test with the router.


Reply to this email directly or view it on GitHub
#278 (comment).

@ghost
Copy link
Author

ghost commented Jan 6, 2016

Jeremy,

Throwing in the converter was not my scenario, probably a good test to see that the router does not quit working.

Karl

@jdanyow
Copy link
Contributor

jdanyow commented Feb 25, 2016

Ah- I see what you mean- given a binding expression like this ${message | myConverter:myArgument}, there are no errors in the console when myArgument is not defined (eg the view-model has no myArgument property).

We've got an open issue for this here: #30

@EisenbergEffect
Copy link
Contributor

I think it's two things. One is the bogus parameter not being detected but the thing that really caused stuff to "break" was probably that the converter expected a value and tried to work with that in a way that an exception was thrown when it wasn't present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants