Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

RFC: Error reporting/promises refactor #105

Open
aurbano opened this issue Mar 25, 2020 · 1 comment
Open

RFC: Error reporting/promises refactor #105

aurbano opened this issue Mar 25, 2020 · 1 comment
Labels

Comments

@aurbano
Copy link
Owner

aurbano commented Mar 25, 2020

As discussed in #80, authentication errors are async so they can't be handled properly at the moment.

A simple fix would be to modify callbacks to be callback(error, data) instead of the current callback(data).

We could be backwards compatible by doing callback(data, error), although this would go against standard library convention, so open to opinions on this as well.

Another option would be to refactor into using promises. Or even do both (optional callbacks, and promise returns): #86 offers a nice proposal for this by @evanshortiss I'm leaning towards this and will do some work for it in the following days unless anyone has a better idea

Open for comments! These changes will be released as v2 of Robinhood-node

@mmahalwy
Copy link

+1 for promise support

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants