import json


def load_mock(file_path):
    """Return the content of the mock file trying to validate JSON

    Raises:
    json.JSONDecodeError
    IOError
    """
    with open(file_path, 'rb') as f:
        try:
            json_decoded = json.load(f)
            return json_decoded
        except json.JSONDecodeError as e:
            raise json.JSONDecodeError(e.msg, e.doc, e.pos)