Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing return values for set #1

Closed
LinusU opened this issue Sep 21, 2018 · 2 comments
Closed

Confusing return values for set #1

LinusU opened this issue Sep 21, 2018 · 2 comments
Labels
good first issue Good for newcomers

Comments

@LinusU
Copy link

LinusU commented Sep 21, 2018

I don’t understand the “Example Fail for Set”, will the promise resolve with that value?

Returning boolean success flags is, in my opinion, very bad api design in JavaScript. Why not reject the promise with a proper error object when the call fails, and resolve it with undefined when the call succeeded?

@talut
Copy link
Owner

talut commented Sep 21, 2018

Now I review my code android can't throw any error when a key is already removed. So I changed the code for like if is key stored/updated is succeeded message will be "Key stored/updated successfully" otherwise it will throw error. On getting stored key if succeeded will return value but otherwise it will throw error. ((under api 23) it will return null) But at removing I don't have a throwable error. So if this key returning null value that's means user already removed this. Deleting keystore is returning false that's means user already removed this. But at IOS I can't apply this kind solution I think. Now I'm working for IOS solution.

@talut talut added the good first issue Good for newcomers label Sep 21, 2018
@talut talut closed this as completed Sep 21, 2018
@talut
Copy link
Owner

talut commented Sep 21, 2018

Updating to version 1.0.7 will answer your questions 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants