ContactError

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

Installation:

To use this API in your project, add the contacts plugin:

webworks plugin add com.blackberry.pim.contacts
Properties:
Number code

code

A code specifying the type of error that occurred.

Synopsis:

read-only
Number ContactError.code

Example:

function findContacts() {
		var contacts = blackberry.pim.contacts;
		contacts.find(["name"], null, onFindSuccess, onFindError);
}

function onFindSuccess(contacts) {
		alert("Contact find succeeded");
}

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

UNKNOWN_ERROR

An unknown error occurred.

Synopsis:

constant
Number ContactError.UNKNOWN_ERROR = 0

TIMEOUT_ERROR

The operation timed out.

Synopsis:

constant
Number ContactError.TIMEOUT_ERROR = 2

PERMISSION_DENIED_ERROR

The operation failed due to insufficient permissions.

Synopsis:

constant
Number ContactError.PERMISSION_DENIED_ERROR = 20

PENDING_OPERATION_ERROR

The operation failed because a previous operation is pending.

Synopsis:

constant
Number ContactError.PENDING_OPERATION_ERROR = 3

NOT_SUPPORTED_ERROR

The operation is not supported.

Synopsis:

constant
Number ContactError.NOT_SUPPORTED_ERROR = 5

IO_ERROR

An IO error occurred.

Synopsis:

constant
Number ContactError.IO_ERROR = 4

INVALID_ARGUMENT_ERROR

A parameter was incorrect.

Synopsis:

constant
Number ContactError.INVALID_ARGUMENT_ERROR = 1

Last modified: 2014-10-09



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus