mirror of
https://github.com/lanqian528/chat2api.git
synced 2026-06-13 21:02:46 +08:00
This commit is contained in:
parent
c469ee32fb
commit
048bdbed88
@ -54,9 +54,10 @@ async def chat_refresh(refresh_token):
|
||||
access_token = r.json()['access_token']
|
||||
return access_token
|
||||
else:
|
||||
raise Exception("Unknown or invalid refresh token.")
|
||||
raise Exception(r.text[:100])
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=f"Failed to refresh access_token: {str(e)}")
|
||||
logger.error(f"Failed to refresh access_token: {str(e)}")
|
||||
raise HTTPException(status_code=500, detail=f"Failed to refresh access_token.")
|
||||
finally:
|
||||
await client.close()
|
||||
del client
|
||||
|
||||
Loading…
Reference in New Issue
Block a user