Use raise from e when load driver error (#1689)

This commit is contained in:
scdhh
2023-02-09 10:24:27 +08:00
committed by GitHub
parent 720c736343
commit 4c0d4065c5
5 changed files with 10 additions and 10 deletions

View File

@ -37,10 +37,10 @@ try:
from fastapi.responses import Response
from fastapi import FastAPI, Request, UploadFile, status
from starlette.websockets import WebSocket, WebSocketState, WebSocketDisconnect
except ImportError: # pragma: no cover
except ImportError as e: # pragma: no cover
raise ImportError(
"Please install FastAPI by using `pip install nonebot2[fastapi]`"
) from None
) from e
def catch_closed(func):