Skip to content

Fix regression in the LiteLLM exception list#4748

Merged
paul-gauthier merged 1 commit into
Aider-AI:mainfrom
claui:fix-litellm-exception-list-regression
Jan 4, 2026
Merged

Fix regression in the LiteLLM exception list#4748
paul-gauthier merged 1 commit into
Aider-AI:mainfrom
claui:fix-litellm-exception-list-regression

Conversation

@claui

@claui claui commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

In an attempt to fix issue #4615, commit 656301c introduced 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.

This PR narrows down the filter so it only tries to include actual exception classes and excludes classes like ErrorEventError.
It also removes ErrorEventError from the exception list.

Fixes issue #4615 and #4724. Reverts commit 656301c.

In an attempt to fix issue Aider-AI#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 Aider-AI#4615 [1] and Aider-AI#4724 [3]. Reverts commit 656301c [2].

[1]: Aider-AI#4615

[2]: Aider-AI@656301c

[3]: Aider-AI#4724
@paul-gauthier
paul-gauthier merged commit fb05748 into Aider-AI:main Jan 4, 2026
2 of 9 checks passed
@paul-gauthier

Copy link
Copy Markdown
Collaborator

Thanks!

@claui
claui deleted the fix-litellm-exception-list-regression branch January 4, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants