```python
def line_tag(body: str) -> str:
    if not isinstance(body, str):
        raise ValueError("line_tag expects a string")
    return format(sum(ord(ch) for ch in body) % 256, "02x")


def check_line(line: str) -> str:
    if not isinstance(line, str) or len(line) < 3:
        raise ValueError("check_line expects a non-empty string of at least three characters")
    
    tilde_index = line.rfind('~')
    if tilde_index == -1 or tilde_index + 2 >= len(line):
        raise ValueError("check_line expects a line with a tilde separating the body from the tag")
    
    body = line[:tilde_index]
    expected_tag = line_tag(body)
    
    if line[tilde_index + 2:] != expected_tag:
        raise ValueError(f"check_line expects the tag to match the computed value for the body: {expected_tag}")
    
    return body
```