diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index 59af5f38a..7f3a93ba8 100644 --- a/continuedev/src/continuedev/steps/core/core.py +++ b/continuedev/src/continuedev/steps/core/core.py @@ -332,3 +332,19 @@ class WaitForUserConfirmationStep(Step): self.description = self.prompt resp = await sdk.wait_for_user_input() return TextObservation(text=resp) + + +def get_python_traceback(output: str) -> str: + if "Traceback" in output: + return output + else: + return None + +def get_javascript_traceback(output: str) -> str: + lines = output.splitlines("\n") + if len(lines) > 0: + first_line = lines[0].split(": ") + if len(lines) > 1 and len(first_line) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip(): + return output + else: + return None \ No newline at end of file