def METHOD_NAME(type: str):
    """Raise an error if this is not a valid message type.
    .. seealso:: https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
    :param type: The message type to validate.
    :type name: str
    :raises:
        - :class:`InvalidMessageTypeError` - If this is not a valid message type.
    """
    if not is_message_type_valid(type):
        raise InvalidMessageTypeError(type)