diff --git a/pkg/services/rpcsrv/error.go b/pkg/services/rpcsrv/error.go index 68188ae83..a37bc3823 100644 --- a/pkg/services/rpcsrv/error.go +++ b/pkg/services/rpcsrv/error.go @@ -1,8 +1,6 @@ package rpcsrv import ( - "net/http" - "github.com/nspcc-dev/neo-go/pkg/neorpc" ) @@ -36,18 +34,3 @@ func (ab abstractBatch) RunForErrors(f func(jsonErr *neorpc.Error)) { a.RunForErrors(f) } } - -func getHTTPCodeForError(respErr *neorpc.Error) int { - var httpCode int - switch respErr.Code { - case neorpc.BadRequestCode: - httpCode = http.StatusBadRequest - case neorpc.MethodNotFoundCode: - httpCode = http.StatusMethodNotAllowed - case neorpc.InternalServerErrorCode: - httpCode = http.StatusInternalServerError - default: - httpCode = http.StatusUnprocessableEntity - } - return httpCode -} diff --git a/pkg/services/rpcsrv/server.go b/pkg/services/rpcsrv/server.go index ecd8b42b7..b6d0949a6 100644 --- a/pkg/services/rpcsrv/server.go +++ b/pkg/services/rpcsrv/server.go @@ -3100,12 +3100,6 @@ func (s *Server) writeHTTPServerResponse(r *params.Request, w http.ResponseWrite if s.config.EnableCORSWorkaround { setCORSOriginHeaders(w.Header()) } - if r.In != nil { - resp := resp.(abstract) - if resp.Error != nil { - w.WriteHeader(getHTTPCodeForError(resp.Error)) - } - } encoder := json.NewEncoder(w) err := encoder.Encode(resp)