Reconnect on connection timed out (mattermost). Fixes #71

This commit is contained in:
Wim 2016-11-04 23:17:40 +01:00
parent c3a8b7a997
commit 50a0df4279
1 changed files with 3 additions and 1 deletions

View File

@ -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)
}