discovery-api/Overview.src.html
changeset 447 5e36d90b8960
parent 441 b4b2569b4e9b
child 448 865b6f93faac
--- a/discovery-api/Overview.src.html	Tue Aug 20 23:36:58 2013 +0300
+++ b/discovery-api/Overview.src.html	Thu Aug 29 11:01:15 2013 +0200
@@ -145,8 +145,8 @@
       <p>
         If a service connectivity request is successful then the Web page is provided with a promise-based success
         callback with the all necessary information to communicate with the authorized Local-networked Service. If the
-        request fails then the Web page will receive a promise-based error callback containing an error code describing
-        the cause of Local-networked Service connectivity failure.
+        request fails then the Web page will receive a promise-based error callback containing an error string
+        describing the cause of Local-networked Service connectivity failure.
       </p>
       <p>
         Once connected to a Local-networked Service the Web page can send requests and receive responses to the
@@ -189,7 +189,7 @@
 }
 
 function error( e ) {
-  console.log( "Error occurred: " + e.code );
+  console.log( "Error occurred: " + e.name );
 }
 
 navigator.getNetworkServices('upnp:urn:schemas-upnp-org:service:ContentDirectory:1').then(showServices, error);
@@ -397,17 +397,11 @@
      href="http://dom.spec.whatwg.org/#promise">Promise</a> <a href=
      "#dom-navigator-getnetworkservices">getNetworkServices</a>( in any type );
 };
+
 <a class="externalDFN"
      href=
      "http://www.whatwg.org/specs/web-apps/current-work/complete/timers.html#navigator">Navigator</a> implements <a href=
      "#navigatornetworkservice">NavigatorNetworkService</a>;
-
-[NoInterfaceObject]
-interface <dfn id="navigatornetworkserviceerror">NavigatorNetworkServiceError</dfn> {
-  const unsigned short <a href="#dom-navigatornetworkserviceerror-permission_denied">PERMISSION_DENIED_ERR</a> = 1;
-  const unsigned short <a href="#dom-navigatornetworkserviceerror-unknown_type_prefix">UNKNOWN_TYPE_PREFIX_ERR</a> = 2;
-  readonly attribute unsigned short <a href="#dom-navigatornetworkserviceerror-code">code</a>;
-};
 </pre>
       <section>
         <h2>
@@ -472,12 +466,12 @@
             below. Otherwise, reject <var>Network Service Promise</var> by running the <a href=
             "http://dom.spec.whatwg.org/#concept-resolver-reject"
                   class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
-                  Resolver</var>, passing in a new <a href=
-                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
-                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 2
-                  (<a href=
-                  "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) as
-                  its argument, abort any remaining steps and return.
+                  Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
+                  class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the string
+                  value "UnknownTypePrefixError" (<a href=
+                  "#dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a>) and whose
+                  <code>message</code> attribute has a helpful implementation-dependent message that explains this
+                  error, abort any remaining steps and return.
             </li>
             <li>
               <em>Process</em>: Let <var>services found</var> be an empty array.
@@ -509,12 +503,12 @@
             platform limitations, the <a>user agent</a> MAY reject <var>Network Service Promise</var> by running the
             <a href="http://dom.spec.whatwg.org/#concept-resolver-reject"
                   class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
-                  Resolver</var>, passing in a new <a href=
-                  "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
-                  "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
-                  (<a href=
-                  "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
-                  argument, abort any remaining steps and return.
+                  Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
+                  class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the string
+                  value "PermissionDeniedError" (<a href=
+                  "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) and whose
+                  <code>message</code> attribute has a helpful implementation-dependent message that explains this
+                  error, abort any remaining steps and return.
             </li>
             <li>The user agent MUST NOT provide the entry script's origin with a <a href=
             "#networkservices"><code>NetworkServices</code></a> object without prior permission given by the user.
@@ -543,12 +537,12 @@
                 MUST reject <var>Network Service Promise</var> by running the <a href=
                 "http://dom.spec.whatwg.org/#concept-resolver-reject"
                    class="externalDFN">resolver reject algorithm</a> against the <var>Network Service Promise's
-                   Resolver</var>, passing in a new <a href=
-                   "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
-                   "#dom-navigatornetworkserviceerror-code"><code>code</code></a> attribute has the numeric value 1
-                   (<a href=
-                   "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
-                   argument, abort any remaining steps and return.
+                   Resolver</var>, passing in a newly constructed <a href="http://dom.spec.whatwg.org/#domerror"
+                   class="externalDFN"><code>DOMError</code></a> object whose <code>name</code> attribute has the
+                   string value "PermissionDeniedError" (<a href=
+                   "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) and whose
+                   <code>message</code> attribute has a helpful implementation-dependent message that explains this
+                   error, abort any remaining steps and return.
               </p>
               <p>
                 If the user never responds or no previously-established user preference has been met, this algorithm
@@ -656,38 +650,38 @@
         </h3>
         <dl class="domintro">
           <dt>
-            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-code"><a href=
-            "#dom-navigatornetworkserviceerror-code">code</a></code>
+            <var title="">error</var> . <code title="dom-NavigatorNetworkServiceError-name"><a href=
+            "#dom-domerror-extensions-name">name</a></code>
           </dt>
           <dd>
             <p>
-              Returns the current error's error code. At the current time, this will be <code>1</code> or
-              <code>2</code>, for which the corresponding error constants <a href=
-              "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
-              "#dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are
-              defined.
+              Returns the current error's error name. At the current time, this will be "PermissionDeniedError" or
+              "UnknownTypePrefixError", for which the corresponding error constants <a href=
+              "#dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></a> and <a href=
+              "#dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></a> are defined.
             </p>
           </dd>
         </dl>
         <p>
-          The <dfn id="dom-navigatornetworkserviceerror-code"
-             title="dom-navigatornetworkserviceerror-code"><code>code</code></dfn> attribute of a <a href=
-             "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object <em class=
-             "ct">MUST</em> return the code for the error, which will be one of the following:
+          The <dfn id="dom-domerror-extensions-name"
+             title="dom-domerror-extensions-name"><code>name</code></dfn> attribute of a <a href=
+             "http://dom.spec.whatwg.org/#domerror"
+             class="externalDFN"><code>DOMError</code></a> object returned from this API <em class="ct">MUST</em>
+             return the name for the error, which will be one of the following:
         </p>
         <dl>
           <dt>
-            <dfn id="dom-navigatornetworkserviceerror-permission_denied"
-                title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn>
-                (numeric value 1)
+            <dfn id="dom-domerror-extensions-permission_denied"
+                title="dom-domerror-extensions-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (DOMString
+                value "PermissionDeniedError")
           </dt>
           <dd>
             The user or user agent denied the page permission to access any services.
           </dd>
           <dt>
-            <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix"
-                title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
-                (numeric value 2)
+            <dfn id="dom-domerror-extensions-unknown_type_prefix"
+                title="dom-domerror-extensions-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn>
+                (DOMString value "UnknownTypePrefixError")
           </dt>
           <dd>
             No <a>valid service type</a> tokens were provided in the method invocation.
@@ -2091,7 +2085,7 @@
   }
 
   function errorCallback( error ) {
-    debug.innerHTML += "&lt;br&gt;An error occurred: " + error.code;
+    debug.innerHTML += "&lt;br&gt;An error occurred: " + error.name;
   }
 &lt;/script&gt;
 </pre>