MCPcopy Create free account
hub / github.com/OpenCodeInterpreter/OpenCodeInterpreter / get_error_header

Function get_error_header

demo/utils/cleaner.py:8–13  ·  view source on GitHub ↗
(traceback_str)

Source from the content-addressed store, hash-verified

6SITE_PKG_ERROR_PREFIX = f'File {PYTHON_PREFIX}/lib/python3.10/'
7
8def get_error_header(traceback_str):
9 lines = traceback_str.split('\n')
10 for line in lines:
11 if 'Error:' in line:
12 return line
13 return '' # Return None if no error message is found
14
15def clean_error_msg(error_str:str =''):
16 filtered_error_msg = error_str.__str__().split('An error occurred while executing the following cell')[-1].split("\n------------------\n")[-1]

Callers 1

clean_error_msgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected