Xmla.Exception Class
This class is used to indicate an runtime errors occurring in any of the methods of the xmla4js 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. The purpose is to provide a clean and clear way for applications that use xmla4js to recognize and handle Xmla4js specific runtime errors.
To handle Xmla4js errors, you can use a try...catch block like this:
try {
...general xmla4js work...
} catch (exception) {
if (exception instanceof Xmla.Exception) {
...use exception.code, exception.message and exception.data to handle the exception.
} else {
...handle other errors...
}
}
Constructor
Xmla.Exception
()
Item Index
Methods
Properties
- args
- code
- data
- ERROR_INSTANTIATING_XMLHTTPREQUEST static
- ERROR_PARSING_RESPONSE_CDE static
- helpfile
- HTTP_ERROR_CDE static
- ILLEGAL_ARGUMENT static
- INVALID_AXIS static
- INVALID_EVENT_HANDLER_CDE static
- INVALID_FIELD_CDE static
- INVALID_HIERARCHY_CDE static
- message
- MISSING_REQUEST_TYPE_CDE static
- MISSING_STATEMENT_CDE static
- MISSING_URL_CDE static
- NO_EVENTS_SPECIFIED_CDE static
- source
- type
- TYPE_ERROR static
- TYPE_WARNING static
- UNEXPECTED_ERROR_READING_MEMBER_CDE static
- UNKNOWN_EVENT_CDE static
- WRONG_EVENTS_FORMAT_CDE 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_INSTANTIATING_XMLHTTPREQUEST
Int
final
static
Exception code indicating that we couldn't instantiate a xml http request object
Default: <code>-15</code>
ERROR_PARSING_RESPONSE_CDE
Int
final
static
Exception code indicating that the rrepsonse could not be parsed
Default: <code>-8</code>
helpfile
String
A path or url that points to a document that contains more information about this error.
Default: {null}
HTTP_ERROR_CDE
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: <code>-10</code>
ILLEGAL_ARGUMENT
Int
final
static
Exception code indicating illegal number of axis arguments
Default: <code>-14</code>
INVALID_AXIS
Int
final
static
Exception code indicating the requested axis does not exist
Default: <code>-13</code>
INVALID_EVENT_HANDLER_CDE
Int
final
static
Exception code indicating that no proper handler was passed for the events.
Default: <code>-7</code>
INVALID_FIELD_CDE
Int
final
static
Exception code indicating the field name is not valid.
Default: <code>-9</code>
INVALID_HIERARCHY_CDE
Int
final
static
Exception code indicating the hierarchy name is not valid.
Default: <code>-11</code>
message
String
A human readable message that describes the nature of the error or warning.
Default: {null}
MISSING_REQUEST_TYPE_CDE
Int
final
static
Exception code indicating a requestType option was expected but ommitted.
Default: <code>-1</code>
MISSING_STATEMENT_CDE
Int
final
static
Exception code indicating a statement option was expected but ommitted.
Default: <code>-2</code>
MISSING_URL_CDE
Int
final
static
Exception code indicating a url option was expected but ommitted.
Default: <code>-3</code>
NO_EVENTS_SPECIFIED_CDE
Int
final
static
Exception code indicating a events were expected but ommitted.
Default: <code>-4</code>
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 Xmla.Exception class,
and indicates that this Xmla.Exception signals an error.
Default: <code>error</code>
TYPE_WARNING
String
final
static
Can appear as value for the type property of instances of the Xmla.Exception class,
and indicates that this Xmla.Exception signals a warning.
Default: <code>warning</code>
UNEXPECTED_ERROR_READING_MEMBER_CDE
Int
final
static
Exception code indicating a problem reading a member property
Default: <code>-12</code>
UNKNOWN_EVENT_CDE
Int
final
static
Exception code indicating that the event name was unrecognized.
Default: <code>-6</code>
WRONG_EVENTS_FORMAT_CDE
Int
final
static
Exception code indicating a events were specifeid in the wrong format.
Default: <code>-5</code>
