Skip to content

Commit

Permalink
Merge pull request #865 from dickens7/feat-wirteerror
Browse files Browse the repository at this point in the history
fix: handler mode write error
  • Loading branch information
smallnest authored Jul 18, 2024
2 parents 9d62234 + d5ee82d commit ff384af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,12 @@ func (s *Server) processOneRequest(ctx *share.Context, req *protocol.Message, co
sctx := NewContext(ctx, conn, req, s.AsyncWrite)
err := handler(sctx)
if err != nil {
log.Errorf("[handler internal error]: servicepath: %s, servicemethod, err: %v", req.ServicePath, req.ServiceMethod, err)
if s.HandleServiceError != nil {
s.HandleServiceError(err)
} else {
log.Errorf("[handler internal error]: servicepath: %s, servicemethod, err: %v", req.ServicePath, req.ServiceMethod, err)
}
sctx.WriteError(err)
}

return
Expand Down

0 comments on commit ff384af

Please sign in to comment.