You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, when using a Validator with a custom condition, the error message is not indicative enough.
For example: Validator("ipify_api_list", condition=lambda x: len(x) > 5)
would result in: dynaconf.validator.ValidationError: ipify_api_list invalid for <lambda>(['api.ipify.com']) in env main
Describe the solution you'd like
Add a new, "error_msg" option for Validator that will be shown as the error message
Additional context
I'll be glad to make a PR for this myself.
The text was updated successfully, but these errors were encountered:
custom_msg="You cannot set {name} to {value} in env {env}"settings.validators.register(
Validator("VERSION", ne=1, messages={"operations": custom_msg}),
)
Is your feature request related to a problem? Please describe.
Currently, when using a Validator with a custom condition, the error message is not indicative enough.
For example:
Validator("ipify_api_list", condition=lambda x: len(x) > 5)
would result in:
dynaconf.validator.ValidationError: ipify_api_list invalid for <lambda>(['api.ipify.com']) in env main
Describe the solution you'd like
Add a new, "error_msg" option for Validator that will be shown as the error message
Additional context
I'll be glad to make a PR for this myself.
The text was updated successfully, but these errors were encountered: