proper error on local account missing

This commit is contained in:
tobi 2024-04-08 17:40:00 +02:00
parent 1075259684
commit ff24ea113b

View file

@ -49,14 +49,10 @@ func (p *Processor) EmailGetUserForConfirmToken(ctx context.Context, token strin
if user.Account == nil {
user.Account, err = p.state.DB.GetAccountByID(ctx, user.AccountID)
if !errors.Is(err, db.ErrNoEntries) {
// Real error.
if err != nil {
// We need the account for a local user.
return nil, gtserror.NewErrorInternalError(err)
}
// No account found for this user,
// or error populating account.
return nil, gtserror.NewErrorNotFound(err)
}
if !user.Account.SuspendedAt.IsZero() {