Overview
Therelational_error_parsing_function is the core function for executing commands, capturing errors, and gathering contextual information about files involved in the error.
Function Signature
Parameters
Command to execute as a list of arguments (e.g.,
['python3', 'test.py'])Optional flag to control file collection behavior:
""(empty): Collect only files mentioned in the error traceback"-r": Recursively collect all files related to the error through import dependencies
Returns
Behavior
- Executes the command specified in
entrypoint - Captures any errors that occur during execution
- Parses the error traceback to identify involved files
- If
-rflag is provided:- Builds a dependency graph of file relationships
- Recursively finds all files connected to error files through imports
- Packages all relevant file contents using
run_mock_repopack()
Example Usage
Basic Error Parsing
Recursive Dependency Collection
Notes
- Returns empty strings
("", "", "")if no error occurs - Uses
subprocess.CalledProcessErrorto capture command failures - File paths are resolved relative to the current working directory
- The
-rflag is useful for understanding complex error contexts across multiple modules