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

fix(js): promise handle error and rn updates #211

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

TimoGlastra
Copy link
Member

Some additional updates after #209.

It addresses two things:

  • also handle error code mismatch in the promise callback
  • update the RN implementation to handle the errors in the same way as we updated to in the node js wrapper. @berendsliedrecht you mentioned it was already implemented correctly in RN, were you talking about the unnessary error calling? Because the code matching logic was not present in the RN wrapper.

I've changed the mismatch behaviour handling to now throw an error with the original errorCode, and a custom message "Error has already been overwritten, unable to provide error message". That way it won't break the calling implementation, as long as they use errorCodes to handle errors. I've looked and it seems we're not using error message from Askar anymore to do error handling, so this should fix the problem, except for not always having the correct error message in the logs.

Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Copy link
Contributor

@berendsliedrecht berendsliedrecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking about the "only call get error when an error actually occurred", yes. Not the error code mismatch

@TimoGlastra TimoGlastra merged commit 8cea88c into main Dec 21, 2023
28 checks passed
@TimoGlastra TimoGlastra deleted the fix/promise-handle-error branch December 21, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants