CDA.Exception Class
This class is used to indicate an runtime errors occurring in any of the methods of the CDAjs classes.
You do not need to instantiate objects of this class yourself. Rather, instances of this class are created and thrown at runtime whenever an error occurs.
To handle CDAjs errors, you can use a try...catch
block like this:
try { ...general cdajs work... } catch (exception) { if (exception instanceof CDA.Exception) { ...use exception.code, exception.message and exception.data to handle the exception. } else { ...handle other errors... } }
Constructor
CDA.Exception
()
Item Index
Methods
Properties
- args
- code
- data
- ERROR_CDA_OPTIONS_CODE static
- ERROR_CDA_PASSWORD_CODE static
- ERROR_CDA_URL_CODE static
- ERROR_CDA_USERNAME_CODE static
- ERROR_MISSING_DATA_ACCESS_ID_CODE static
- ERROR_MISSING_PARAMS_CODE static
- ERROR_MISSING_PARAMS_PATH_CODE static
- helpfile
- HTTP_ERROR_CODE static
- message
- source
- type
- TYPE_ERROR static
- TYPE_WARNING static
Methods
getStackTrace
()
Get a stack trace.
Returns:
an array of objects describing the function on the stack
toString
()
Returns a string representing this exception
Returns:
a string representing this exception
Properties
args
Array
A reference to the built-in arguments
array of the function that is throwing
the exception This can be used to get a "stack trace"
code
Int
A code that can be used to identify this particular kind of exception.
Default: null
data
String
Additional data captured when the exception was instantiated. The type of information stored here is dependent upon the nature of the error.
Default: null
ERROR_CDA_OPTIONS_CODE
Int
final
static
Exception code indicating that missing options in the constructor.
Default: -2
ERROR_CDA_PASSWORD_CODE
Int
final
static
Exception code indicating that missing password for Pentaho authentication.
Default: -5
ERROR_CDA_URL_CODE
Int
final
static
Exception code indicating that missing the CDA URL.
Default: -1
ERROR_CDA_USERNAME_CODE
Int
final
static
Exception code indicating that missing username for Pentaho authentication.
Default: -4
ERROR_MISSING_DATA_ACCESS_ID_CODE
Int
final
static
Exception code indicating that missing data access id for CDA query.
Default: -6
ERROR_MISSING_PARAMS_CODE
Int
final
static
Exception code indicating that missing params object for invoke CDA endpoint.
Default: -7
ERROR_MISSING_PARAMS_PATH_CODE
Int
final
static
Exception code indicating that missing path property on object params for invoke CDA endpoint.
Default: -9
helpfile
String
A path or url that points to a document that contains more information about this error.
Default: null
HTTP_ERROR_CODE
Int
final
static
Exception code indicating a general XMLHttpRequest error. If this error occurs, the data object of the exception will have these members:
- request: the options that make up the original HTTP request
- status: the HTTP status code
- statusText: the HTTP status text
Default: -3
message
String
A human readable message that describes the nature of the error or warning.
Default: null
source
String
A name that indicates in what component (on the client or server side) this error or warning occurred.
Default: null
type
String
This propery indicates what kind of exception occurred. It can have one of the following values:
TYPE_WARNING
- Indicates a warning
TYPE_ERROR
- Indicates an error
Default: null
TYPE_ERROR
String
final
static
Can appear as value for the type property of instances of the CDA.Exception class, and
indicates that this CDA.Exception
signals an error.
Default: error
TYPE_WARNING
String
final
static
Can appear as value for the type property of instances of the CDA.Exception class, and
indicates that this CDA.Exception
signals a warning.
Default: warning