From db25ee59c5c9a46feed526133bea6b296256a960 Mon Sep 17 00:00:00 2001 From: Alec WM Date: Thu, 15 Mar 2018 20:50:32 +0100 Subject: Print list of valid team names when team not found (#390) --- matterclient/matterclient.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'matterclient') diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index f539a76d..79787917 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -190,7 +190,11 @@ func (m *MMClient) Login() error { } if m.Team == nil { - return errors.New("team not found") + validTeamNames := make([]string, len(m.OtherTeams)) + for i, t := range m.OtherTeams { + validTeamNames[i] = t.Team.Name + } + return fmt.Errorf("Team '%s' not found in %v", m.Credentials.Team, validTeamNames) } m.wsConnect() -- cgit v1.2.3