Everything You Need to Know


Error Handling

Letting You Know When You do Something Wrong

ChocolateChip-UI has its own error system. It checks the arguments or methods you invoke for views, models and events. This is great while your in development. The errors try to describe the problem as clearly as possible so that you can understand what you've done wrong. Most errors involve trying to do something with an property does not exist. For example, a view might now have an element, or template or bound model and you are trying to access them. When you do this, ChocolateChip-UI will log and error in the browser console. Whenever you do see the result you were expecting in your app, open the console and check for errors.

When you are finished developing your app and want to move to production, you can turn the ChocolateChip-UI error messages off. To do so, just put the following assignment before any of your other code:

$.supressErrorMessages = true;
// You app code here.

This will stop ChocolateChip-UI from logging errors about its functions. However, if you have JavaScript that is invalid, the browser will still throw and exception.