From 50a0df427927b60724d8e6e00ba06822e0aa7308 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 4 Nov 2016 23:17:40 +0100 Subject: [PATCH] Reconnect on connection timed out (mattermost). Fixes #71 --- matterclient/matterclient.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index aa944a18..38be9b00 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -125,9 +125,11 @@ func (m *MMClient) Login() error { if appErr != nil { d := b.Duration() m.log.Debug(appErr.DetailedError) + //TODO more generic fix needed if !strings.Contains(appErr.DetailedError, "connection refused") && !strings.Contains(appErr.DetailedError, "invalid character") && - !strings.Contains(appErr.DetailedError, "connection reset by peer") { + !strings.Contains(appErr.DetailedError, "connection reset by peer") && + !strings.Contains(appErr.DetailedError, "connection timed out") { if appErr.Message == "" { return errors.New(appErr.DetailedError) }