mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
show more error detail for invalidMessageError
This commit is contained in:
parent
df3f0a81a7
commit
204e00a91f
1 changed files with 2 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ package rpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
|
@ -152,7 +153,7 @@ func (s *Server) serveSingleRequest(ctx context.Context, codec ServerCodec) {
|
||||||
reqs, batch, err := codec.readBatch()
|
reqs, batch, err := codec.readBatch()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != io.EOF {
|
if err != io.EOF {
|
||||||
resp := errorMessage(&invalidMessageError{"parse error"})
|
resp := errorMessage(&invalidMessageError{fmt.Sprintf("parse error: %s", err.Error())})
|
||||||
codec.writeJSON(ctx, resp, true)
|
codec.writeJSON(ctx, resp, true)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue