Fix regression in the LiteLLM exception list#4748
Merged
paul-gauthier merged 1 commit intoJan 4, 2026
Merged
Conversation
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
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In an attempt to fix issue #4615, commit 656301c introduced a regression where running the
coderfeature raises the following error:The primary misunderstanding that caused the regression is the fact that
ErrorEventErrorsounds like an error class that needs to be included in the exceptions list. In reality, however, the nameErrorEventErroris just a coincidence and actually belongs to a regular class, which doesn’t haveBaseExceptionin its chain of base classes.Current Python versions raise a
TypeErrorat runtime if you try to include such a class name in anexceptclause, 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
ErrorEventErrorfrom the exception list.Fixes issue #4615 and #4724. Reverts commit 656301c.