bridgev2/matrix: handle token errors in /versions properly
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled

Fixes mautrix/signal#554
This commit is contained in:
Tulir Asokan 2024-09-21 17:51:54 +03:00
commit 7324f6edec

View file

@ -264,6 +264,9 @@ func (br *Connector) ensureConnection(ctx context.Context) {
br.logInitialRequestError(err, "Failed to register after /versions failed with M_FORBIDDEN")
os.Exit(16)
}
} else if errors.Is(err, mautrix.MUnknownToken) || errors.Is(err, mautrix.MExclusive) {
br.logInitialRequestError(err, "/versions request failed with auth error")
os.Exit(16)
} else {
br.Log.Err(err).Msg("Failed to connect to homeserver, retrying in 10 seconds...")
time.Sleep(10 * time.Second)