From 1608bdf6126e840b57d4811f18ed206d4f055ed6 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 29 Nov 2021 19:47:04 +0200 Subject: [PATCH] Add better error messages for some setup issues --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 37845e7..b742258 100644 --- a/main.go +++ b/main.go @@ -205,7 +205,10 @@ func (bridge *Bridge) ensureConnection() { resp, err := bridge.Bot.Whoami() if err != nil { if errors.Is(err, mautrix.MUnknownToken) { - bridge.Log.Fatalln("Access token invalid. Is the registration installed in your homeserver correctly?") + bridge.Log.Fatalln("The as_token was not accepted. Is the registration file installed in your homeserver correctly?") + os.Exit(16) + } else if errors.Is(err, mautrix.MExclusive) { + bridge.Log.Fatalln("The as_token was accepted, but the /register request was not. Are the homeserver domain and username template in the config correct, and do they match the values in the registration?") os.Exit(16) } bridge.Log.Errorfln("Failed to connect to homeserver: %v. Retrying in 10 seconds...", err)