docs: def _get_contract_exception_dict(contract_msg):
      """Generate message for exception."""
      # A pcontract-defined custom exception message is wrapped in a string
      # that starts with '[START CONTRACT MSG:' and ends with
      # '[STOP CONTRACT MSG]'. This is done to easily detect if an
      # exception raised is from a custom contract and thus be able
      # to easily retrieve the actual exception message
      start_token = "[START CONTRACT MSG: "
      stop_token = "[STOP CONTRACT MSG]"
      # No custom contract
      if contract_msg.find(start_token) == -1:
          return {
              "num": 0,
              "msg": "Argument `*[argument_name]*` is not valid",
              "type": RuntimeError,
              "field": "argument_name",
          }
      # Custom contract
      msg_start = contract_msg.find(start_token) + len(start_token)
      contract_msg = contract_msg[msg_start:]
      contract_name = contract_msg[: contract_msg.find("]")]
      contract_msg = contract_msg[
          contract_msg.find("]") + 1 : contract_msg.find(stop_token)
      ]
      exdict = _CUSTOM_CONTRACTS[contract_name]
      for exvalue in exdict.values():  # pragma: no branch
          if exvalue["msg"] == contract_msg:
              return exvalue