CalendarError

The CalendarError object contains error codes and is returned in the error callback.


Supported Platform(s)

- BlackBerry 10
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
code           Y 
UNKNOWN_ERROR           Y 
INVALID_ARGUMENT_ERROR           Y 
TIMEOUT_ERROR           Y 
PENDING_OPERATION_ERROR           Y 
IO_ERROR           Y 
NOT_SUPPORTED_ERROR           Y 
PERMISSION_DENIED_ERROR           Y 

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

You must declare the feature element(s) below in your configuration document:

Feature IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<feature id="blackberry.pim.calendar" />           Y 

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Properties

Number code

Properties

readonly Number code


A code specifying the type of error that occurred.


Supported Platforms
 - BlackBerry 10


Code Example:
var calendar = blackberry.pim.calendar,
    evt;

function saveEvent() {
    // Not providing the end date will cause
    // INVALID_ARGUMENT_ERROR
    evt = calendar.createEvent({
       "summary": "A test Event",
       "location": "Waterloo",
       "start": new Date("Jan 01, 2015, 12:00"),
       "timezone": "America/New_York"
    });
    evt.save(onSaveSuccess, onSaveError);
}

function onSaveSuccess(created) {
    // set evt to the object returned in save success callback, which
    // contains the persisted event id
    evt = created;
    alert("Event saved to device: " + evt.id);
}

function onSaveError(error) {
    switch (error.code) {
    case error.UNKNOWN_ERROR:
        alert("Save event error: An unknown error occurred");
        break;
    case error.INVALID_ARGUMENT_ERROR:
        alert("Save event error: Invalid argument");
        break;
    case error.PERMISSION_DENIED_ERROR:
        alert("Save event error: Permission denied error");
        break;
    default:
        alert("Save event error: other error, code=" + error.code);
    }
}

Constants

static Number UNKNOWN_ERROR = 0


An unknown error occurred.


Supported Platforms
 - BlackBerry 10

static Number INVALID_ARGUMENT_ERROR = 1


A parameter was incorrect.


Supported Platforms
 - BlackBerry 10

static Number TIMEOUT_ERROR = 2


The operation timed out.


Supported Platforms
 - BlackBerry 10

static Number PENDING_OPERATION_ERROR = 3


The operation failed because a previous operation is pending.


Supported Platforms
 - BlackBerry 10

static Number IO_ERROR = 4


An IO error occurred.


Supported Platforms
 - BlackBerry 10

static Number NOT_SUPPORTED_ERROR = 5


The operation is not supported.


Supported Platforms
 - BlackBerry 10

static Number PERMISSION_DENIED_ERROR = 20


The operation failed due to insufficient permissions.


Supported Platforms
 - BlackBerry 10

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:15:32 GMT-0500 (EST)