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

for JS users: check type of ttl argument, client constructor arguments at run time #649

Open
cprice404 opened this issue Jul 18, 2023 · 0 comments

Comments

@cprice404
Copy link
Contributor

cprice404 commented Jul 18, 2023

This ticket is intended to help improve error messaging for devs who are developing directly in JS as opposed to TS.

we have had some users hit an issue where they passed in the wrong ttl type (numeric vs CollectionTtl) for the different APIs. In the case where they pass in a CollectionTtl for a scalar API, the error message is very confusing and makes it seem like a server-side error. For dynamic languages we should probably do more validation to head off issues like this.

For now we should at least look at the error that happens in this case and do enough validation to give a better error.

In addition: if you pass the wrong names for the options arguments for the Client constructors, the constructor succeeds but then you can get a very confusing error at runtime. See: #919 . We should validate the contructor args at runtime and throw a clear error message for JS users.

@cprice404 cprice404 changed the title check type of ttl argument at run time check type of ttl argument, client constructor arguments at run time Sep 18, 2023
@cprice404 cprice404 changed the title check type of ttl argument, client constructor arguments at run time for JS users: check type of ttl argument, client constructor arguments at run time Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant