BTT Web 2.0 On-Demand Workplace provides a debug mechanism, which includes
log, debug, error, warn, assert, info and so on. It requires that your browser
have installed the corresponding debugger (Firebug Lite). For example, Firebug
for Firefox, or Firebug Lite for IE.
If you don't want to install the debugger, you can include the firebug-lite.js under
the _firebug folder.
BTT Web2.0 On-Demand Workplace provides various kinds of exception types
for the web developer to detect and locate the cause of an error or an exception.
- BTTError
BTT Web2.0 On-Demand Workplace catches BTTError in the following
cases:
- The corresponding language resource file can not be found when loading
language resources. Or there is syntax errors in the language resource file.
- CatalogService initialization is failed.
- The resource uri is null when loading the resource, or the type of resource
file is not JavaScript™ or CSS.
- WidgetDefinition initialization is failed.
- BTTTypeError
BTT Web2.0 On-Demand Workplace catches BTTTypeError in
the following cases:
- The id of a widget is null when loading the widget definition file.
- The iContext provided method parameter’s type error
- BTTWidgetError
BTT Web2.0 On-Demand Workplace catches BTTWidgetError
in the following cases:
- The constructor of a specified widget can not be found when creating IScope
of the widget container.
- The specified mode is not defined when switching the widget’s mode.
- BTTXmlError
BTT Web2.0 On-Demand Workplace catches BTTXMLError in the
following cases:
- The entries in catalog definition file has no child, or error occurs when
parsing the catalog xml file
- Cannot find the specified widget file in catalog definition file
- The entry item in catalog definition file is without 'definition' attribute,
or it is null
Following is an example for exception handling in BTT Web2.0 On-Demand
Workplace:
Error definition in widget JavaScript:
var rootNodeError=this.iContext.getElementsByClass({});
When running the application, the error information is found in Firebug
console: