MCPcopy Create free account
hub / github.com/THUDM/AutoWebGLM / check_unhandled_errors

Function check_unhandled_errors

webarena/scripts/check_error_runs.py:87–109  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

85
86
87def check_unhandled_errors(args: argparse.Namespace) -> int:
88 log_path = merge_logs(args.result_folder, args)
89 with open(log_path, "r") as f:
90 logs = f.read()
91
92 error_examples = []
93 for line in logs.split("\n"):
94 if "[Config file]" in line:
95 example_idx = line.split("/")[-1].split(".")[0]
96 if "[Unhandled Error]" in line or "[OpenAI Error]" in line:
97 error_examples.append(int(example_idx))
98
99 num_errors = len(error_examples)
100 print(f"Number of unhandled errors: {len(error_examples)}")
101 print(error_examples)
102 if (
103 args.delete_errors
104 or input("Do you want to delete these examples? (y/n)") == "y"
105 ):
106 for idx in error_examples:
107 if os.path.exists(f"{args.result_folder}/render_{idx}.html"):
108 os.remove(f"{args.result_folder}/render_{idx}.html")
109 return num_errors
110
111
112def check_unexpected_logout(args: argparse.Namespace) -> int:

Callers 1

Calls 1

merge_logsFunction · 0.85

Tested by

no test coverage detected