discovery-api/Overview.src.html
changeset 447 5e36d90b8960
parent 441 b4b2569b4e9b
child 448 865b6f93faac
     1.1 --- a/discovery-api/Overview.src.html	Tue Aug 20 23:36:58 2013 +0300
     1.2 +++ b/discovery-api/Overview.src.html	Thu Aug 29 11:01:15 2013 +0200
     1.3 @@ -145,8 +145,8 @@
     1.4        <p>
     1.5          If a service connectivity request is successful then the Web page is provided with a promise-based success
     1.6          callback with the all necessary information to communicate with the authorized Local-networked Service. If the
     1.7 -        request fails then the Web page will receive a promise-based error callback containing an error code describing
     1.8 -        the cause of Local-networked Service connectivity failure.
     1.9 +        request fails then the Web page will receive a promise-based error callback containing an error string
    1.10 +        describing the cause of Local-networked Service connectivity failure.
    1.11        </p>
    1.12        <p>
    1.13          Once connected to a Local-networked Service the Web page can send requests and receive responses to the
    1.14 @@ -189,7 +189,7 @@
    1.15  }
    1.16  
    1.17  function error( e ) {
    1.18 -  console.log( "Error occurred: " + e.code );
    1.19 +  console.log( "Error occurred: " + e.name );
    1.20  }
    1.21  
    1.22  navigator.getNetworkServices('upnp:urn:schemas-upnp-org:service:ContentDirectory:1').then(showServices, error);
    1.23 @@ -397,17 +397,11 @@
    1.24       href="http://dom.spec.whatwg.org/#promise">Promise</a> <a href=
    1.25       "#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type );
    1.26  };
    1.27 +
    1.28  <a class="externalDFN"
    1.29       href=
    1.30       "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href=
    1.31       "#navigatornetworkservice">NavigatorNetworkService</a>;
    1.32 -
    1.33 -[NoInterfaceObject]
    1.34 -interface <dfn id="navigatornetworkserviceerror">NavigatorNetworkServiceError</dfn> {
    1.35 -  const unsigned short <a href="#dom-navigatornetworkserviceerror-permission_denied">PERMISSION_DENIED_ERR</a> = 1;
    1.36 -  const unsigned short <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix">UNKNOWN_TYPE_PREFIX_ERR</a> = 2;
    1.37 -  readonly attribute unsigned short <a href="#dom-navigatornetworkserviceerror-code">code</a>;
    1.38 -};
    1.39  </pre>
    1.40        <section>
    1.41          <h2>
    1.42 @@ -472,12 +466,12 @@
    1.43              below. Otherwise, reject <var>Network Service Promise</var> by running the <a href=
    1.44              "http://dom.spec.whatwg.org/#concept-resolver-reject"
    1.45                    class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
    1.46 -                  Resolver</var>, passing in a new <a href=
    1.47 -                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
    1.48 -                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
    1.49 -                  (<a href=
    1.50 -                  "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as
    1.51 -                  its argument, abort any remaining steps and return.
    1.52 +                  Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
    1.53 +                  class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the string
    1.54 +                  value "UnknownTypePrefixError" (<a href=
    1.55 +                  "#dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) and whose
    1.56 +                  <code>message</code> attribute has a helpful implementation-dependent message that explains this
    1.57 +                  error, abort any remaining steps and return.
    1.58              </li>
    1.59              <li>
    1.60                <em>Process</em>: Let <var>services found</var> be an empty array.
    1.61 @@ -509,12 +503,12 @@
    1.62              platform limitations, the <a>user agent</a> MAY reject <var>Network Service Promise</var> by running the
    1.63              <a href="http://dom.spec.whatwg.org/#concept-resolver-reject"
    1.64                    class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
    1.65 -                  Resolver</var>, passing in a new <a href=
    1.66 -                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
    1.67 -                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
    1.68 -                  (<a href=
    1.69 -                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
    1.70 -                  argument, abort any remaining steps and return.
    1.71 +                  Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
    1.72 +                  class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the string
    1.73 +                  value "PermissionDeniedError" (<a href=
    1.74 +                  "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) and whose
    1.75 +                  <code>message</code> attribute has a helpful implementation-dependent message that explains this
    1.76 +                  error, abort any remaining steps and return.
    1.77              </li>
    1.78              <li>The user agent MUST NOT provide the entry script's origin with a <a href=
    1.79              "#networkservices"><code>NetworkServices</code></a> object without prior permission given by the user.
    1.80 @@ -543,12 +537,12 @@
    1.81                  MUST reject <var>Network Service Promise</var> by running the <a href=
    1.82                  "http://dom.spec.whatwg.org/#concept-resolver-reject"
    1.83                     class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
    1.84 -                   Resolver</var>, passing in a new <a href=
    1.85 -                   "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
    1.86 -                   "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
    1.87 -                   (<a href=
    1.88 -                   "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
    1.89 -                   argument, abort any remaining steps and return.
    1.90 +                   Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
    1.91 +                   class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the
    1.92 +                   string value "PermissionDeniedError" (<a href=
    1.93 +                   "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) and whose
    1.94 +                   <code>message</code> attribute has a helpful implementation-dependent message that explains this
    1.95 +                   error, abort any remaining steps and return.
    1.96                </p>
    1.97                <p>
    1.98                  If the user never responds or no previously-established user preference has been met, this algorithm
    1.99 @@ -656,38 +650,38 @@
   1.100          </h3>
   1.101          <dl class="domintro">
   1.102            <dt>
   1.103 -            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-code"><a href=
   1.104 -            "#dom-navigatornetworkserviceerror-code">code</a></code>
   1.105 +            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-name"><a href=
   1.106 +            "#dom-domerror-extensions-name">name</a></code>
   1.107            </dt>
   1.108            <dd>
   1.109              <p>
   1.110 -              Returns the current error's error code. At the current time, this will be <code>1</code> or
   1.111 -              <code>2</code>, for which the corresponding error constants <a href=
   1.112 -              "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
   1.113 -              "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are
   1.114 -              defined.
   1.115 +              Returns the current error's error name. At the current time, this will be "PermissionDeniedError" or
   1.116 +              "UnknownTypePrefixError", for which the corresponding error constants <a href=
   1.117 +              "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
   1.118 +              "#dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are defined.
   1.119              </p>
   1.120            </dd>
   1.121          </dl>
   1.122          <p>
   1.123 -          The <dfn id="dom-navigatornetworkserviceerror-code"
   1.124 -             title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a <a href=
   1.125 -             "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class=
   1.126 -             "ct">MUST</em> return the code for the error, which will be one of the following:
   1.127 +          The <dfn id="dom-domerror-extensions-name"
   1.128 +             title="dom-domerror-extensions-name"><code>name</code></dfn> attribute of a <a href=
   1.129 +             "http://dom.spec.whatwg.org/#domerror"
   1.130 +             class="externalDFN"><code>DOMError</code></a> object returned from this API <em class="ct">MUST</em>
   1.131 +             return the name for the error, which will be one of the following:
   1.132          </p>
   1.133          <dl>
   1.134            <dt>
   1.135 -            <dfn id="dom-navigatornetworkserviceerror-permission_denied"
   1.136 -                title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn>
   1.137 -                (numeric value 1)
   1.138 +            <dfn id="dom-domerror-extensions-permission_denied"
   1.139 +                title="dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (DOMString
   1.140 +                value "PermissionDeniedError")
   1.141            </dt>
   1.142            <dd>
   1.143              The user or user agent denied the page permission to access any services.
   1.144            </dd>
   1.145            <dt>
   1.146 -            <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix"
   1.147 -                title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
   1.148 -                (numeric value 2)
   1.149 +            <dfn id="dom-domerror-extensions-unknown_type_prefix"
   1.150 +                title="dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
   1.151 +                (DOMString value "UnknownTypePrefixError")
   1.152            </dt>
   1.153            <dd>
   1.154              No <a>valid service type</a> tokens were provided in the method invocation.
   1.155 @@ -2091,7 +2085,7 @@
   1.156    }
   1.157  
   1.158    function errorCallback( error ) {
   1.159 -    debug.innerHTML += "&lt;br&gt;An error occurred: " + error.code;
   1.160 +    debug.innerHTML += "&lt;br&gt;An error occurred: " + error.name;
   1.161    }
   1.162  &lt;/script&gt;
   1.163  </pre>