On Thu, Sep 25, 2014 at 6:08 PM, Kyle Machulis <[email protected]> wrote:
>
> Return fake DOMRequest-like objects that instantly fail?

I favor this, although not sure what is meant by fake vs. just a real
DOMRequest that doesn’t do anything special/will not call onsuccess,
just onerror.

Expressing the failure via an onerror call would match what I would
expect from promise-like code: any operation that is async should get
an object that captures the result of the operation, and handle the
success or errors as functions. For DOMRequest, it is attaching .on*
properties, for promises it is passing functions to .then().

This also means the error handling is just in one place, the .onerror.
Instead of needing to manage a try{} around the acquisition of the
DOMRequest and then in the .onerror.

James
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to