W3C home > Mailing lists > Public > public-payments-wg@w3.org > January 2016

Re: [webpayments] PROPOSAL: The PaymentRequest object will not have code attached to it. It will be a pure data object. (#64)

From: Manu Sporny <notifications@github.com>
Date: Sat, 23 Jan 2016 12:43:59 -0800
To: w3c/webpayments <webpayments@noreply.github.com>
Message-ID: <w3c/webpayments/issues/64/174219732@github.com>
> So a developer could, if they wanted, check the state before calling cancel, but if they don't, the system will just throw an exception.

This is exactly my point. Why do you need to expose the state information in this case if you can get an answer to the question by just trying to cancel and catching the exception? The developers code gets more complicated because now they have to check the state before canceling (note - they have to be /aware/ of the state and knowing when they can and can't cancel - added complexity), and they may even still need to do a try/catch block anyway because other things can cause an exception.

This is exactly the sort of stuff that XMLHttpRequest got wrong (be aware of state before calling certain methods, check state, but even when you do check state, things can still go wrong so you still have to try/catch).

Reply to this email directly or view it on GitHub:
Received on Saturday, 23 January 2016 20:44:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:43:13 UTC