Commit 50171c8
committed
Use isinstance() instead of type() == for exception type checking
Replace `type(e) == litellm.exceptions.RateLimitError` with
`isinstance(e, litellm.exceptions.RateLimitError)` for proper exception
type checking.
While technically different behavior (isinstance() supports
inheritance while type() == requires exact match), isinstance() is the
correct and more robust approach for exception handling. If litellm
introduces subclasses of RateLimitError in the future, isinstance() will
correctly catch them.1 parent 0070d75 commit 50171c8
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
0 commit comments