Improve hijack failure error text

Include "hijack" in text to indicate where in this package the error
occurred.
This commit is contained in:
tebuka 2024-06-12 21:15:45 -07:00 committed by Canelo Hill
parent 22bd06da63
commit 4378cca251
1 changed files with 2 additions and 1 deletions

View File

@ -174,7 +174,8 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
netConn, brw, err := http.NewResponseController(w).Hijack() netConn, brw, err := http.NewResponseController(w).Hijack()
if err != nil { 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 { if brw.Reader.Buffered() > 0 {