From 4378cca2518bb8a278c5b0ff17b3f4222409c806 Mon Sep 17 00:00:00 2001 From: tebuka <171117698+tebuka@users.noreply.github.com> Date: Wed, 12 Jun 2024 21:15:45 -0700 Subject: [PATCH] Improve hijack failure error text Include "hijack" in text to indicate where in this package the error occurred. --- server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index 3ecb2d9..3e3826b 100644 --- a/server.go +++ b/server.go @@ -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 {