Skip to content

Commit cbfe953

Browse files
committed
More precise error messages in gui
Fixes #228
1 parent 5f31330 commit cbfe953

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmd/launcher/gui/gui_progress_handler.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package gui
22

33
import (
44
"fmt"
5+
"strings"
56
"sync"
67

78
"net/http"
@@ -72,7 +73,14 @@ func (handler *GuiDownloadProgressHandler) HandleHttpGetError(fromURL string, er
7273
handler.progressMutex.Lock()
7374
defer handler.progressMutex.Unlock()
7475
handler.problemUrl = fromURL
75-
NotifyProblem("Cannot reach server", false)
76+
77+
if strings.Contains(err.Error(), "x509: ") {
78+
NotifyProblem("Certificate verification problem", false)
79+
} else if strings.Contains(err.Error(), "timed out") {
80+
NotifyProblem("Timeout reaching server", false)
81+
} else {
82+
NotifyProblem("Problems reaching server", false)
83+
}
7684
}
7785

7886
func (handler *GuiDownloadProgressHandler) HandleBadHttpResponse(fromURL string, code int) {

0 commit comments

Comments
 (0)