SIGN IN SIGN UP

fix: exclude regular classes that end with `Error`

In an attempt to fix issue #4615 [1], commit 656301c [2] introduces a
regression where running the `coder` feature raises the following error:

> TypeError: catching classes that do not inherit from BaseException is not allowed

The primary misunderstanding that caused the regression is the fact that
`ErrorEventError` sounds like an error class that needs to be included
in the exceptions list. In reality, however, the name `ErrorEventError`
is just a coincidence and actually belongs to a regular class, which
doesn’t have `BaseException` in its chain of base classes.

Current Python versions raise a `TypeError` at runtime if you try to
include such a class name in an `except` clause, which explains why the
error shows up.

Narrow down the filter so it only tries to include actual exception
classes and excludes classes like `ErrorEventError`.
Also remove `ErrorEventError` from the exception list.

Fixes issue #4615 [1] and #4724 [3]. Reverts commit 656301c [2].

[1]: https://github.com/Aider-AI/aider/issues/4615

[2]: https://github.com/Aider-AI/aider/commit/656301cc8744bd32d1bb25ddcc839774bc73e4ca

[3]: https://github.com/Aider-AI/aider/issues/4724
C
Claudia Pellegrino committed
08165c57a21636d0f995abf55de33fd9bbbcee94
Parent: 1354e0b