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

Need better type-checking. #1

Open
jtremback opened this issue Jan 27, 2015 · 0 comments
Open

Need better type-checking. #1

jtremback opened this issue Jan 27, 2015 · 0 comments

Comments

@jtremback
Copy link
Member

I'd like all errors that have to do with incorrect arguments or types being passed to microstar to be caught by type-check. This will make it easier to implement, and developers won't have to track down errors caused by simple typos for hours.

The minimum is to catch errors before they leave microstar. This will greatly help those who are familiar with the microstar source. I've done a tiny bit of this already, in level-librarian:

https://github.com/microstar-db/level-librarian/blob/master/index.js#L117

This will catch incorrectly formatted indexes before they cause a confusing error which may only occur later, on read.

Ideally though, we would catch errors as they go into any microstar module. This means that all arguments of most methods across modules should contain a type-check statement and throw an informative error. This is going to be a lot of repetitive code, but think about it this way- it's really not any worse than writing in a strongly typed language. We'll hold off on this second goal until modules are much more stabilized though.

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