class_docstr: An exception that formats out a standardized error message for a
  bad parameter.  This is useful when thrown from a callback or type as
  Click will attach contextual information to it (for instance, which
  parameter it is).
  
  .. versionadded:: 2.0
  
  :param param: the parameter object that caused this error.  This can
                be left out, and Click will attach this info itself
                if possible.
  :param param_hint: a string that shows up as parameter name.  This
                     can be used as alternative to `param` in cases
                     where custom validation should happen.  If it is
                     a string it's used as such, if it's a list then
                     each item is quoted and separated.
class_docstr_tok: ["An","exception","that","formats","out","a","standardized","error","message","for","a","bad","parameter",".","This","is","useful","when","thrown","from","a","callback","or","type","as","Click","will","attach","contextual","information","to","it","(","for","instance",",","which","parameter","it","is",")",".","..","versionadded",":",":","2.0",":","param","param",":","the","parameter","object","that","caused","this","error",".","This","can","be","left","out",",","and","Click","will","attach","this","info","itself","if","possible",".",":","param","param_hint",":","a","string","that","shows","up","as","parameter","name",".","This","can","be","used","as","alternative","to","`","param","`","in","cases","where","custom","validation","should","happen",".","If","it","is","a","string","it","'s","used","as","such",",","if","it","'s","a","list","then","each","item","is","quoted","and","separated","."]
code: def format_message(self) -> str:
      if self.param_hint is not None:
          param_hint = self.param_hint
      elif self.param is not None:
          param_hint = self.param.get_error_hint(self.ctx)  # type: ignore
      else:
          return _("Invalid value: {message}").format(
              message=self.message
          )
  
      return _("Invalid value for {param_hint}: {message}").format(
          param_hint=_join_param_hints(param_hint), message=self.message
      )
  
imports: import typing
  from gettext import gettext
  from gettext import ngettext
  from ._compat import get_text_stderr
  from .utils import echo
  from .utils import format_filename
label_desc: Use image node_id 2 for calling the BadParameter obj's underlying member method code with example usage: obj.format_message() and returns: _, _