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

Group missing required field errors. #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bchapman
Copy link

Don't stop processing when an required variable is missing, instead build a list of the missing variables, and throw a single error at the end.

This change results in an error message such as
required key(s) missing values: FOO,BAR

Related to #143

@TonyPythoneer
Copy link

@bchapman

I don't agree.

If there is any required tag, when the value is empty, it should early return the error.

@hbobenicio
Copy link

hbobenicio commented Dec 16, 2019

I totally agree with the change request here

It makes no sense to stop on the first error. It is just lazy.

Imagine a system with dozens of required fields. Running the server dozens of times to get the missing values from the environment is just not helpful (specially on production environments which may have a long environment variables list and modifying them may take some time between redeploys and log analysis).

This change is really simple, maintainable, doesn't hurt performance and greatly improves UX.
Thanks @bchapman!

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

Successfully merging this pull request may close these issues.

3 participants