import requests


def block_info(block_hash):
    """Return block info given its hash."""
    r = requests.get(f"https://blockchain.info/rawblock/{block_hash}")
    
    if r.status_code != 200:
        err_string = f"block_info failed on block_hash={block_hash} with {r} because {r.reason}"
        print(err_string)
        raise Exception(err_string)
    
    return r.json()