reveal traceback

This commit is contained in:
fuqingxu 2024-07-02 21:09:24 +08:00
parent 04d8006c86
commit 24d480b4b1
3 changed files with 9 additions and 1 deletions

3
.gitignore vendored
View file

@ -133,6 +133,9 @@ dmypy.json
# macOS
.DS_Store
# vscode
.vscode
# docs
docs/sphinx_doc/build/

View file

@ -185,7 +185,9 @@ class CliMemoryChat(BaseMemoryChat):
break
except Exception as e:
line = f"An exception occurred when running cli memory chat. args={e.args}"
import traceback
traceback.print_exc()
line = f"An exception occurred when running cli memory chat. args={e.args}."
questionary.print(line)
self.logger.exception(line)
continue

View file

@ -1,5 +1,6 @@
import inspect
import time
import dashscope
from abc import abstractmethod, ABCMeta
from typing import Any
@ -86,6 +87,8 @@ class BaseModel(metaclass=ABCMeta):
for i in range(self.max_retries):
try:
model_response = self._call(stream=stream, **kwargs)
except dashscope.common.error.AuthenticationError as e:
raise e
except Exception as e:
model_response = ModelResponse(m_type=self.m_type, status=False, details=e.args)