_get_exception_class_name

This commit is contained in:
Ishaan Jaff 2025-04-04 21:23:21 -07:00
parent c402db9057
commit f402e9bbd1
2 changed files with 7 additions and 5 deletions

View file

@ -1148,7 +1148,9 @@ class PrometheusLogger(CustomLogger):
@staticmethod
def _get_exception_class_name(exception: Exception) -> str:
exception_class_name = getattr(exception, "llm_provider") or ""
exception_class_name = ""
if hasattr(exception, "llm_provider"):
exception_class_name = getattr(exception, "llm_provider") or ""
# pretty print the provider name on prometheus
# eg. `openai` -> `Openai.`