Errors: throw vs return

All,

Our SubtleCrypto methods do *not* "throw" errors. Instead we call the
reject handler of the promise with the error object (to be a DOMException
according to the other thread).

My question is how we should describe termination with errors in the
asynchronous substeps and the steps of the operations. We could say:

"Return a SyntaxError"

or

"Throw a SyntaxError"

In either case we need to make the Step 4 or each method clearer:

"4. If the following steps or the steps of invoked operations
(throw|return) an error, perform the following sub-steps and terminate this
algorithm"

Since we might invoke other web platform procedures - like WebIDL type
conversion for example - which "throw" errors - perhaps we should use the
throw terminology in our procedures (and handle it in Step 4 of the method
procedures). Step 4 is like the "try ... catch ... " around all the
operations and other referenced procedures below.

Thoughts ?

...Mark

Received on Thursday, 6 March 2014 00:00:15 UTC