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

number.multiple() throws exception for non-integer and ref values #916

Closed
santanu-biswas opened this issue Jun 10, 2016 · 4 comments
Closed
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@santanu-biswas
Copy link
Contributor

santanu-biswas commented Jun 10, 2016

number.multiple() accepts only integers (throws exception). It neither accepts floats/decimals nor does it accept refs.

So, it accepts number.multiple(2), but does not accept number.multiple(2.5).
It also does not accept number.multiple(Joi.ref('anotherKey')).

It seems the code here explicitly throws a exception for anything non-integer.

Is this by design? Or a bug?

If it is by design, I am wondering why is it so, and also in such case should it not send the error gracefully for validate call instead of throwing exception!

@Marsup
Copy link
Collaborator

Marsup commented Jun 10, 2016

It's just what we started with, covered the needs of most people. If you need more feel free to put up a PR.

@santanu-biswas
Copy link
Contributor Author

Thanks @Marsup
I have put up a PR as suggested by you.

@santanu-biswas
Copy link
Contributor Author

@Marsup The PR has been rebased to latest master.

@Marsup Marsup closed this as completed in 3a32b92 Jun 22, 2016
@Marsup Marsup added this to the 9.0.0 milestone Jun 22, 2016
@Marsup Marsup self-assigned this Jun 22, 2016
@hueniverse hueniverse added feature New functionality or improvement and removed request labels Sep 19, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants