Skip to content

Commit

Permalink
Improve hijack failure error text
Browse files Browse the repository at this point in the history
Include "hijack" in text to indicate where in this package the error
occurred.
  • Loading branch information
tebuka authored and jaitaiwan committed Jun 19, 2024
1 parent 8890e3e commit 7e5e9b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade

netConn, brw, err := http.NewResponseController(w).Hijack()
if err != nil {
return u.returnError(w, r, http.StatusInternalServerError, err.Error())
return u.returnError(w, r, http.StatusInternalServerError,
"websocket: hijack: "+err.Error())
}

if brw.Reader.Buffered() > 0 {
Expand Down

0 comments on commit 7e5e9b5

Please # to comment.