mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
aider: Change error message format to display the class name instead of the full type.
# Aider chat conversation: USER: res = f"{type(err)}: {err}\n" is producing: "<class 'IndentationError'>: unexpected indent (tmp.syntaxerror.py, line 4)" I want it to say "IndentationError: unexpected indent (tmp.syntaxerror.py, line 4)" ASSISTANT: To change the error message format from `<class 'IndentationError'>: unexpected indent (tmp.syntaxerror.py, line 4)` to `IndentationError: unexpected indent (tmp.syntaxerror.py, line 4)`, we need to modify the line where the error message is being constructed. Here is the *SEARCH/REPLACE* block: aider/linter.py ```python <<<<<<< SEARCH res = f"{type(err)}: {err}\n" ======= res = f"{type(err).__name__}: {err}\n" >>>>>>> REPLACE ```
This commit is contained in:
parent
30c9c4c319
commit
f699241e12
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ def lint_pycompile(fname, code):
|
|||
except Exception as err:
|
||||
dump(dir(err))
|
||||
dump(err.text)
|
||||
res = f"{type(err)}: {err}\n"
|
||||
res = f"{type(err).__name__}: {err}\n"
|
||||
line_numbers = list(range(err.lineno - 1, err.end_lineno))
|
||||
|
||||
dump(line_numbers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue