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.
BTT Web 2.0 On-Demand Workplace provides various kinds of exception types
for the you to detect and locate the cause of an error or an exception.
- BTTError
BTT Web 2.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 URL is null when loading the resource, or the type of resource
file is not JavaScript™ or CSS.
- WidgetDefinition initialization is failed.
- BTTTypeError
BTT Web 2.0 On-Demand Workplace catches BTTTypeError in
the following cases:
- The ID of a widget is null when loading the widget definition file.
- The type of the parameters of the method provided by iContext is wrong.
- 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 instance.
- The specified mode is not defined when switching the widget’s mode.
- BTTXmlError
BTT Web 2.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 does not have the definition attribute,
or it is null.
Following is an example for exception handling in BTT Web 2.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: