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

CBU functions should throw an exception when the number is not valid. #4

Open
hnicodemo opened this issue Apr 6, 2017 · 2 comments

Comments

@hnicodemo
Copy link

I think getAssociatedBank, getBankCode y getBranch should start with:

if (!isValid(cbu)) throw new Error('CBU is not valid);

@miparnisari
Copy link
Owner

@hnicodemo please create a PR and i'll have a look. Thanks!

@gastonelhordoy
Copy link

As a validation library I would suggest not to throw errors. IMHO doing so is a highly opinionated assumption.

Developers using this lib should decide what to do upon an invalid value, either throwing an error, providing a more detailed explanation of the issue in the context of the app or whatever makes sense to them.

Excellent work BTW, I would probably contribute adding new banks like Wilobank.

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

No branches or pull requests

3 participants