Language: Python
Label: safe
CWE: CWE-209 \u2014 Generation of Error Message Containing Sensitive Information
The product generates an error message that includes sensitive information about its environment, users, or associated data.

Code:
def test_format_error_prints_allowed_errors():
    error_cls = ALLOWED_ERRORS[0]
    error = error_cls("Example error")
    result = format_error(error, ())
    assert result["message"] == str(error)