import logging


def has_valid_str_length(data, minimum_length=1, maximum_length=255):
    """ Validate the string lenght is between minimun and maximum length.

    Parameters
    ----------
    data: str
        the strign data to be checked.
    minimum_length: int, optional
        the minimum length of the string.
        default to 1
    miximum_length: int, optional
        the maximum length of the string.
        default to 255

    Returns
    -------
    Boolean

    Raises
    ------
    TypeError:
        for invalid parameter data type.
    Exception:
        for any uncaught syntax error.
    """
    try:
        if not isinstance(data, str):
            raise TypeError("data parameter must be in str data type.")
        if not isinstance(minimum_length, int):
            raise TypeError("minimum_length parameter must be in int data type.")
        if not isinstance(maximum_length, int):
            raise TypeError("maximum_length parameter must be in int data type.")

        str_length = len(data)

        return minimum_length <= str_length <= maximum_length
    except Exception as e:
        logging.error(e)
        raise e