Skip to content

Commit

Permalink
add try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxiBoether committed Oct 19, 2023
1 parent 8c554f4 commit a39bde9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions benchmark/cloc/data_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def extract_single_zip(directory: str, zip_file: str) -> None:

os.makedirs(output_dir, exist_ok=True)

with zipfile.ZipFile(zip_path, "r") as zip_ref:
zip_ref.extractall(output_dir)
try:
with zipfile.ZipFile(zip_path, "r") as zip_ref:
zip_ref.extractall(output_dir)
except Exception as e:
logger.error(f"Error while extracing file {zip_path}")
logger.error(e)

def setup_argparser() -> argparse.ArgumentParser:
parser_ = argparse.ArgumentParser(description=f"CLOC Benchmark Storage Script")
Expand Down

0 comments on commit a39bde9

Please sign in to comment.