-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(cli): suppress stacktrace printing on configuration errors #4718
feat(cli): suppress stacktrace printing on configuration errors #4718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good - seems like there’s a minor formatting issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppressing ValueError directly might cause issues with not having stacktraces. We are throwingValueError
in pydantic validators as well as in other places outside pydantic validators.
Suggestion
- change all places inside pydantic validators to raise
ConfigurationError
instead ofValueError
- Do not suppress
ValueError
@anshbansal I agree that we should remove ValueError from the suppressed list, but for a different reason. pydantic validatiors must throw ValueError, TypeError, or AssertionError (see docs https://pydantic-docs.helpmanual.io/usage/validators/). However, pydantic itself will throw Longer term, we need to switch all of our validators to throw ValueError instead of ConfigurationError, and then remove ConfigurationError from the suppressed list as well. |
Checklist