(json_file: Text)
load json file and check file content format
load json file and check file content format
load json file and check file content format
def _load_json_file(json_file: Text) -> Dict:
    """ load json file and check file content format
    """
    with open(json_file, mode="rb") as data_file:
        try:
            json_content = json.load(data_file)
        except json.JSONDecodeError as ex:
            err_msg = f"JSONDecodeError:\nfile: {json_file}\nerror: {ex}"
            raise exceptions.FileFormatError(err_msg)

        return json_content
def _load_json_file ( json_file : Text ) -> Dict : with open ( json_file , mode = "rb" ) as data_file : try : json_content = json . load ( data_file ) except json . JSONDecodeError as ex : err_msg = f"JSONDecodeError:\nfile: {json_file}\nerror: {ex}" raise exceptions . FileFormatError ( err_msg ) return json_content