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

Improve error message if nested array is incorrect #40

Open
linusthe3rd opened this issue Jul 1, 2018 · 1 comment
Open

Improve error message if nested array is incorrect #40

linusthe3rd opened this issue Jul 1, 2018 · 1 comment

Comments

@linusthe3rd
Copy link

linusthe3rd commented Jul 1, 2018

If a user messes up their nested array in collectPuts, the error message provided is not that helpful as it's written to explain incorrect use of types, but not why a specific assertion failed:

assert(
isMap(envMapping) || isNestedArray(envMapping),
'The second parameter must be a nested array, ' +
'Map or object containing the same under `mapping` key'
)

It would be better if a secondary assertion for the nested array was added to explicitly explain why the array approach failed with an error message of something like:

"The nested arrays must have exactly two arguments".

@timbuckley
Copy link
Owner

@linusthe3rd This is a good suggestion! I'd be happy to have a PR to that effect if you are so inclined 😃

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

2 participants