Appendix A

[23 April 2009]

Revision:
$Rev: 245 $

Abstract

This Appendix defines common parts of the set of API specifications that provide scripted access to device capabilities.

Status of this document

Nokia hereby grants to the W3C a perpetual, nonexclusive, royalty-free, world-wide right and license under any Nokia copyrights on this contribution, to copy, publish and distribute the contribution under the W3C document licenses.

Additionally, should the submission be used as a contribution towards a W3C Activity, Nokia grants a right and license of the same scope to any derivative works prepared by the W3C and based on, or incorporating all or part of, the contribution. Nokia further agrees that any derivative works of this contribution prepared by the W3C shall be solely owned by the W3C.

Nokia Corporation agrees to offer W3C members and non-members granting reciprocal terms a non-assignable, non-sublicensable, worldwide and royalty free license to make, have made, use, sell, have sold, offer to sell, import, and distribute and dispose of implementations of any portion of the submission that is subsequently incorporated into a W3C Recommendation. Such license shall extend to all Essential Claims owned or controlled by Nokia Corporation and shall be available as long as the Recommendation is in effect.

Table of contents

A.1 DeviceException interface

  exception DeviceException { 
     DOMString name;
     DOMString message;
     int       code;
  };
     // Non-recoverable programmatic error codes:
     const unsigned short      MISSING_ARG_ERR                 = 1;
     const unsigned short      INVALID_ARG_ERR                 = 2;
     const unsigned short      NOT_SUPPORTED_ERR               = 3;

     // Recoverable or non-programmatic error codes:
     const unsigned short      TIMEOUT_ERR                    = 100;
     const unsigned short      DATA_NOT_FOUND_ERR             = 101;
     const unsigned short      DATA_ALREADY_EXISTS_ERR        = 102;
     const unsigned short      SERVICE_BUSY_ERR               = 103;
     const unsigned short      SERVICE_IN_USE_ERR             = 104;
     const unsigned short      DATA_OUT_OF_RANGE_ERR          = 105;
     const unsigned short      NOT_ALLOWED_ERR                = 106;
     const unsigned short      SIZE_EXCEEDED_ERR              = 107;
     const unsigned short      INVALID_URI_ERR                = 108;
     const unsigned short      URI_NOT_FOUND_ERR              = 109;
     const unsigned short      URI_ALREADY_EXISTS_ERR         = 110;
  

The name name represents an exception type and contains a value DeviceException.

The message contains a human-readable error message.

The code contains exception code number as specified. Error codes from 1 to 99 represent non-recoverable or programmatic errors. Error codes greater than 99 represent recoverable or non-programmatic errors.

A.2 Device Exception Code Constants

MISSING_ARG_ERR
A mandatory argument of a method is missing.
INVALID_ARG_ERR
The argument passed is of invalid type.
NOT_SUPPORTED_ERR
An attribute is optional and is not supported by the implementation.
TIMEOUT_ERR
The implementation can not give a response within the given time.
DATA_NOT_FOUND_ERR
Referred data entry was not found.
DATA_ALREADY_EXISTS_ERR
Referred data entry already exists.
SERVICE_BUSY_ERR
The service is busy. Implementation is unable to process the request now, try again later.
SERVICE_IN_USE_ERR
Registering for notifications is supported only once.
DATA_OUT_OF_RANGE_ERR
An out of range value was passed.
NOT_ALLOWED_ERR
No permission to access the specified content.
SIZE_EXCEEDED_ERR
Data size exceeded the allowed limits set by the platform or by the configuration. A data overflow error occurred.
INVALID_URI_ERR
The specified URI is invalid.
URI_NOT_FOUND_ERR
The specified URI refers to a non-existing resource.
URI_ALREADY_EXISTS_ERR
The specified URI refers to a existing resource and the resource can not be overwritten.