MCPcopy Create free account
hub / github.com/ChainSafe/nodewatch-api / WriteErrorChunk

Method WriteErrorChunk

crawler/rpc/request/rpc_method.go:301–308  ·  view source on GitHub ↗
(code ResponseCode, msg string)

Source from the content-addressed store, hash-verified

299}
300
301func (h *chReqHandler) WriteErrorChunk(code ResponseCode, msg string) error {
302 if len(msg) > MaxErrSize {
303 msg = msg[:MaxErrSize-3]
304 msg += "..."
305 }
306 b := []byte(msg)
307 return StreamChunk(code, uint64(len(b)), bytes.NewReader(b), h.w, h.comp)
308}
309
310type OnRequestListener func(ctx context.Context, peerId peer.ID, handler ChunkedRequestHandler)
311

Callers

nothing calls this directly

Calls 1

StreamChunkFunction · 0.85

Tested by

no test coverage detected