This chapter describes common errors and explains how to handle them with Visualize.js.
This chapter contains the following sections:
• | Error Properties |
• | Common Errors |
• | Catching Initialization and Authentication Errors |
• | Catching Search Errors |
• | Validating Search Properties |
• | Catching Report Errors |
• | Catching Input Control Errors |
• | Validating Input Controls |
Error Properties
The properties structure for Generic Errors is defined as follows:
Common Errors
The following table lists common errors, their messages, and causes.
Catching Initialization and Authentication Errors
Visualize.js is designed to have many places where you can catch and handle errors. The visualize function definition, as shown in Contents of the Visualize.js Script, is:
During intitialization and authentication, you can handle errors in the third parameter named errorback (an error callback). Your application would then have this structure:
Catching Search Errors
One way to handle search errors is to specify an error handler as the second parameter of run:
Another way to handle search errors is to specify a function as the third parameter of run. This function is an always handler that runs every time when operation ends.
Validating Search Properties
You can also validate the structure of the search properties without making an actual call to the search function:
Catching Report Errors
To catch and handle errors when running reports, define the contents of the err function as shown in the following sample:
Catching Input Control Errors
Catching and handling input control errors is very similar to handling report errors. Define the contents of the err function that gets invoked in error conditions, as shown in the following sample:
Validating Input Controls
You can also validate the structure of your input controls without making an actual call. However, the values of the input controls and their relevance to the named resource are not checked.
Recommended Comments
There are no comments to display.