fix: return more appropriate error on token fetch fail

This commit is contained in:
Paul Makles
2024-04-08 23:24:49 +01:00
parent 3e26e7e89d
commit 4be3bdc4c3

View File

@@ -284,7 +284,7 @@ impl User {
db.fetch_user( db.fetch_user(
&db.fetch_bot_by_token(token) &db.fetch_bot_by_token(token)
.await .await
.map_err(|_| create_error!(InternalError))? .map_err(|_| create_error!(InvalidSession))?
.id, .id,
) )
.await .await