Open iislucas opened 10 years ago
promiseProvider isn't technically needed :smile: The asynchronousProvider passes an errback argument as well as the continuation / callback, which can be done to add rejection without converting a full provider. We can also make the synchronousProvider catch thrown errors and use those as rejections.
Or equivalently, asynchronousProvider isn't technically needed, right? :)
I actually didn't realize there that there was an error propagation mechanism before; that's cool.
error propagation got put in at the same time as promises to keep interfaces functionally equivalent. I don't know if I feel like I want to force every provider to use promises. I can imagine providers using preexisting code, and I'd like to make it as easy as possible for 3rd party code to become a freedom.js provider.
Sure; same argument with Promises. Not actually proposing removing any interface here :)
Just suggesting that core providers use promises (I think that's better coding style to promise) and more importantly, that they signal errors back where appropriate. e.g. as per discussion on social API failure to login, etc.
This allows nicer handling of errors.