raise exception when you meet the error condition ( in your case: when file is not sucesfully parsed)
raise ValueError('File not parsed completely/correctly')
raise relevant error type with suitable message
raise exception when you meet the error condition ( in your case: when file is not sucesfully parsed)
raise ValueError('File not parsed completely/correctly')
raise relevant error type with suitable message