Skip to content

Commit

Permalink
Remove Windows specific error checking conditions.
Browse files Browse the repository at this point in the history
This was blocking builds for mac and linux. In the future I'll look at improving error checking for os specific errors. But for now this enables builds on mac and linux.
  • Loading branch information
jdrews committed Mar 26, 2023
1 parent 87b4b4e commit 0be6f58
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"net/http"
"os"
"regexp"
"syscall"
)

var (
Expand Down Expand Up @@ -178,18 +177,9 @@ func wshandler(c echo.Context, pubSub *pubsub.PubSub) error {
wsErr := ws.WriteMessage(websocket.TextMessage, jsonLine) //TODO: look into using WriteJSON instead to simplify code
//err := ws.WriteJSON(line)
if wsErr != nil {
if errors.Is(wsErr, syscall.WSAECONNABORTED) {
logger.Warn("Lost connection to websocket client! Maybe they're gone? Closing this connection. More info: ")
logger.Warn(wsErr)
break
} else if errors.Is(wsErr, syscall.WSAECONNRESET) {
logger.Warn("Lost connection to websocket client! Maybe they're gone? Closing this connection. More info: ")
logger.Warn(wsErr)
break
} else {
logger.Error(wsErr)
break
}
logger.Warn("Lost connection to websocket client! Maybe they're gone? Closing this connection. More info: ")
logger.Warn(wsErr)
break
}
}
return nil
Expand Down

0 comments on commit 0be6f58

Please sign in to comment.