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

Add error checking for missing data parameter #76

Closed
dpilafian opened this issue Mar 10, 2020 · 3 comments
Closed

Add error checking for missing data parameter #76

dpilafian opened this issue Mar 10, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dpilafian
Copy link
Member

If the data field is missing when cloning a template, the current error message is very confusing. There should be an clear, explicit error message when data is undefined.

const data = undefined;
dna.clone('book', data);  //should immediately throw an error
@dpilafian
Copy link
Member Author

Add a check just before the "Container missing for nested template" check at:
https://github.com/dnajs/dna.js/blob/master/dna.js#L43

with a message something like:

dna.core.berserk('Required data field missing in call to dna.clone', name);

@dpilafian dpilafian assigned dpilafian and unassigned dpilafian Mar 10, 2020
@dpilafian dpilafian added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Mar 10, 2020
@giteshk11
Copy link
Contributor

Hi @dpilafian , I would like to work on this issue

@dpilafian
Copy link
Member Author

@giteshk11 Thanks for completing issue #78 👍.

If you're looking to make additional open source contributions, here are some projects with good "first" issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants