Skip to content

Error while formatting the help message, variable is used in the help_msg but was not found in the available context. #58

@smarie

Description

@smarie
from valid8 import ValidationError, validate

class CustomError(ValidationError):
    help_msg = "{a}='{b}': hello"

validate('dummy', False, equals=True, error_type=CustomError, a=0, b=1)

raises a strange error message

CustomError[ValueError]: Error while formatting the help message, variable 'a}='{b' is used in the help_msg but was not found in the available context. Help message template was '{a}='{b}': hello'. Variables available: {'validator': _QuickValidator<validation_function=validate, none_policy=VALIDATE, exc_type=ValidationError>, 'var_value': False, 'var_name': 'dummy', 'failure': NotEqual(wrong_value=False,append_details=True,ref_value=True,has_context_data=True), 'a': 0, 'b': 1, 'append_details': True}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions