diff options
author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-06-15 23:45:29 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 23:45:29 -0700 |
commit | c42b20fe543cd7550a42c25c3eb834a209abbade (patch) | |
tree | ec33d760acbc8501e7c046e9259ae3d61cf453f1 | |
parent | 1ba5e81852f8af85f0f88536545f075ee45b454b (diff) | |
parent | d6432ea58f2400875745fd7d2b5f4c62f1073786 (diff) | |
download | sncontinue-c42b20fe543cd7550a42c25c3eb834a209abbade.tar.gz sncontinue-c42b20fe543cd7550a42c25c3eb834a209abbade.tar.bz2 sncontinue-c42b20fe543cd7550a42c25c3eb834a209abbade.zip |
Merge pull request #99 from continuedev/tracebacks
parsing python and javascript tracebacks
-rw-r--r-- | continuedev/src/continuedev/steps/core/core.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py index 59af5f38..7f3a93ba 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 |