Skip to content

Commit

Permalink
fix: read timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lss233 committed Apr 18, 2023
1 parent d765018 commit d1d1699
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
from typing import Callable

import httpcore
import openai
from graia.ariadne.message.chain import MessageChain
from graia.ariadne.message.element import Plain
Expand Down Expand Up @@ -233,7 +234,7 @@ async def request(_session_id, prompt: str, conversation_context, _respond):
await respond(respond_msg)
except PresetNotFoundException: # 预设不存在
await respond("预设不存在,请检查你的输入是否有问题!")
except (RequestException, SSLError, ProxyError, MaxRetryError, ConnectTimeout, ConnectTimeout) as e: # 网络异常
except (RequestException, SSLError, ProxyError, MaxRetryError, ConnectTimeout, ConnectTimeout, httpcore.ReadTimeout) as e: # 网络异常
await respond(config.response.error_network_failure.format(exc=e))
except Exception as e: # 未处理的异常
logger.exception(e)
Expand Down

0 comments on commit d1d1699

Please sign in to comment.