Don't try to read stderr when exception is thrown
This commit is contained in:
		
							parent
							
								
									6f5bfef1ed
								
							
						
					
					
						commit
						6eefe16c4b
					
				|  | @ -45,10 +45,10 @@ def transcode_worker(in_track, out_track, encoder): | ||||||
|     additional_args = ('--bitrate', '128', '--music') |     additional_args = ('--bitrate', '128', '--music') | ||||||
|     subprocess_args = (str(encoder),) + additional_args + (in_track, out_track) |     subprocess_args = (str(encoder),) + additional_args + (in_track, out_track) | ||||||
|     try: |     try: | ||||||
|         result = subprocess.run(subprocess_args, capture_output=True, text=True, check=True) |         subprocess.run(subprocess_args, capture_output=True, text=True, check=True) | ||||||
|         return f"Transcoded '{in_track}' successfully" |         return f"Transcoded '{in_track}' successfully." | ||||||
|     except CalledProcessError: |     except CalledProcessError: | ||||||
|         return f"ERROR: Transcoding of '{in_track}' failed with errors:\n{result.stderr}" |         return f"ERROR: Transcoding of '{in_track}' failed." | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def main(input_dir: Path, output_dir: Path, encoder: Path): | def main(input_dir: Path, output_dir: Path, encoder: Path): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user