Skip to content

Commit

Permalink
show launcher check error
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed May 9, 2022
1 parent eaed315 commit f6d19fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/launcher/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ func (lc *Browser) fastestHost() (fastest string, err error) {

go func() {
defer func() {
_ = recover()
err := recover()
if err != nil {
lc.Logger.Println("check result:", err)
}
wg.Done()
}()

Expand All @@ -164,7 +167,7 @@ func (lc *Browser) fastestHost() (fastest string, err error) {
utils.E(err)
defer func() { _ = res.Body.Close() }()

if res.StatusCode < 400 {
if res.StatusCode == http.StatusOK {
buf := make([]byte, 64*1024) // a TCP packet won't be larger than 64KB
_, err = res.Body.Read(buf)
utils.E(err)
Expand Down

0 comments on commit f6d19fe

Please sign in to comment.