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_internal_error_msg_in_debug_mode():
    error = ValueError("Example error")
    result = format_error(error, ())
    assert result["message"] == str(error)