mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: Handle file read errors in linter
This commit is contained in:
parent
3a96a10d06
commit
212e22b2b7
1 changed files with 5 additions and 1 deletions
|
@ -83,7 +83,11 @@ class Linter:
|
|||
|
||||
def lint(self, fname, cmd=None):
|
||||
rel_fname = self.get_rel_fname(fname)
|
||||
code = Path(fname).read_text(encoding=self.encoding, errors="replace")
|
||||
try:
|
||||
code = Path(fname).read_text(encoding=self.encoding, errors="replace")
|
||||
except OSError as err:
|
||||
print(f"Unable to read {fname}: {err}")
|
||||
return
|
||||
|
||||
if cmd:
|
||||
cmd = cmd.strip()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue