def check_error(child):
    """Raise an error for a problem with a child process."""
    if child.returncode != 0:
        output = (child.stdout + child.stderr).decode('utf-8')
        raise OSError('Problem encountered getting tshark JSON:' + output)
