From 68a49f353954bb32289f6e80281b2ed14312f679 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Tue, 8 Sep 2020 17:46:09 +0200 Subject: [feat] be more precise when login gives 502 --- pkg/backend/api.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/backend/api.go b/pkg/backend/api.go index 1985e6b..ea148f7 100644 --- a/pkg/backend/api.go +++ b/pkg/backend/api.go @@ -18,7 +18,11 @@ func Login(username, password string) { success, err := ctx.bm.DoLogin(username, password) if err != nil { log.Printf("Error on login: %v", err) - ctx.Errors = "bad_auth" + if err.Error() == "Cannot get token: Error 502" { + ctx.Errors = "bad_auth_502" + } else { + ctx.Errors = "bad_auth" + } } else if success { log.Printf("Logged in as %s", username) ctx.LoginOk = true -- cgit v1.2.3