def str_is_int(s):
    """Checks if a string can be converted to int."""
    if not isinstance(s, str):
        raise TypeError('str_is_int function only accepts strings.')
    try:
        int(s)
        return True
    except ValueError as e:
        if 'invalid literal' in str(e):
            return False
        else:
            raise e