Commit b70b7032 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

add error trace

parent b52e4bb0
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ class Pipeline:
        self.message = Message(os.path.join(self.dir_out, "msg.txt"))
        self.time_stamp = TimeStamp(os.path.join(self.dir_out, "time_stamp.txt"))
        self.exit_code = ExitCode(os.path.join(self.dir_out, "exit_code"))
        self.error_trace = ErrorTrace(os.path.join(self.dir_out, "error_trace"))

        if dfs:
            self.dfs = DFS(n_try=5)
@@ -101,6 +102,18 @@ class Pipeline:
        warnings.resetwarnings()


class ErrorTrace:
    def __init__(self, file_path=""):
        self.file_path = file_path

    def __repr__(self):
        return f"< ErrorTrace [{self.file_path}] >"

    def write(self, s: str):
        with open(self.file_path, "w+") as f:
            f.write(s)


class Message:
    def __init__(self, file_path=""):
        self.file_path = file_path