From bba9ca3d5ae658c9c41c215a76103dd8a1e02027 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 12:45:29 -0800 Subject: [PATCH] feat: add get_ex_info method to lookup exception info --- aider/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aider/exceptions.py b/aider/exceptions.py index e3346916f..41a977985 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -88,6 +88,10 @@ class LiteLLMExceptions: def exceptions_tuple(self): return tuple(self.exceptions) + def get_ex_info(self, ex): + """Return the ExInfo for a given exception instance""" + return self.exceptions.get(ex.__class__) + litellm_ex = LiteLLMExceptions()