Эх сурвалжийг харах

Add better error messages for some setup issues

Tulir Asokan 3 жил өмнө
parent
commit
1608bdf612
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      main.go

+ 4 - 1
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)