mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac: chat exception handling
This commit is contained in:
parent
5832c3ea97
commit
20b6892d9b
1 changed files with 14 additions and 6 deletions
|
|
@ -39,13 +39,21 @@ router = APIRouter()
|
||||||
async def get_session_user_chat_list(
|
async def get_session_user_chat_list(
|
||||||
user=Depends(get_verified_user), page: Optional[int] = None
|
user=Depends(get_verified_user), page: Optional[int] = None
|
||||||
):
|
):
|
||||||
if page is not None:
|
try:
|
||||||
limit = 60
|
if page is not None:
|
||||||
skip = (page - 1) * limit
|
limit = 60
|
||||||
|
skip = (page - 1) * limit
|
||||||
|
|
||||||
return Chats.get_chat_title_id_list_by_user_id(user.id, skip=skip, limit=limit)
|
return Chats.get_chat_title_id_list_by_user_id(
|
||||||
else:
|
user.id, skip=skip, limit=limit
|
||||||
return Chats.get_chat_title_id_list_by_user_id(user.id)
|
)
|
||||||
|
else:
|
||||||
|
return Chats.get_chat_title_id_list_by_user_id(user.id)
|
||||||
|
except Exception as e:
|
||||||
|
log.exception(e)
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=status.HTTP_400_BAD_REQUEST, detail=ERROR_MESSAGES.DEFAULT()
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
############################
|
############################
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue