good morning!!!!

Skip to content
Snippets Groups Projects
Commit e570dcf7 authored by Garet Halliday's avatar Garet Halliday
Browse files

move error

parent 7ac56e48
No related branches found
Tags v0.0.38
1 merge request!25move error
Pipeline #30249 passed with stage
in 4 minutes and 33 seconds
package http
import (
"context"
"errors"
"net/http"
"sync"
"gfx.cafe/open/jrpc/pkg/server"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
"gfx.cafe/open/jrpc/pkg/server"
)
func HttpHandler(s *server.Server) http.Handler {
......@@ -31,9 +34,9 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
c := NewCodec(w, r)
w.Header().Set("content-type", contentType)
err := s.Server.ServeCodec(r.Context(), c)
if err != nil {
// slog.Error("codec err", "err", err)
if err != nil && !errors.Is(err, context.Canceled) {
// slog.Error("codec err", "err", err)
http.Error(w, "Internal Error", http.StatusInternalServerError)
}
http.Error(w, "Internal Error", http.StatusInternalServerError)
<-c.Closed()
}
......@@ -5,9 +5,10 @@ import (
"errors"
"sync"
"gfx.cafe/open/jrpc/pkg/jsonrpc"
"golang.org/x/sync/semaphore"
"gfx.cafe/open/jrpc/pkg/jsonrpc"
"gfx.cafe/util/go/bufpool"
"github.com/go-faster/jx"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment