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: explicitly handle async JavaScript failures. #293

Merged

Conversation

DavidVujic
Copy link
Collaborator

Explicit checks for errors by validating the result code coming from the C Client.

Description

All calls to methods in the promisified version of the JavaScript client has now an explicit result code check. A result code that has a negative value is a failure, and the method will from now on perform a reject.

Before this, errors failed silently, as described in issue #237 - the issue is about the set method, but the error exists in all promisified method calls.

Motivation and Context

fixes #237

How Has This Been Tested?

npm tests passed
CircleCI passed
added example code that verifies the behaviour.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

lib/zk_promise.js Outdated Show resolved Hide resolved
…e sure a fallback is set if the code is not found
@DavidVujic DavidVujic merged commit 6aa33f3 into yfinkelstein:master Jan 5, 2022
@DavidVujic DavidVujic deleted the handle_async_js_call_failures branch January 5, 2022 20:58
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.

Check Path with / character when calling set()
1 participant