MCPcopy
hub / github.com/nats-io/nats.go / Error

Method Error

micro/request.go:51–51  ·  view source on GitHub ↗

Error prepares and publishes error response from a handler. A response error should be set containing an error code and description. Optionally, data can be set as response payload.

(code, description string, data []byte, opts ...RespondOpt)

Source from the content-addressed store, hash-verified

49 // A response error should be set containing an error code and description.
50 // Optionally, data can be set as response payload.
51 Error(code, description string, data []byte, opts ...RespondOpt) error
52
53 // Data returns request data.
54 Data() []byte

Callers 9

AddServiceFunction · 0.65
reqHandlerMethod · 0.65
ExampleFunction · 0.65
ExampleContextHandlerFunction · 0.65
ExampleRequest_ErrorFunction · 0.65
TestServiceBasicsFunction · 0.65
TestContextHandlerFunction · 0.65
TestRequestRespondFunction · 0.65

Implementers 1

requestmicro/request.go

Calls

no outgoing calls

Tested by 6

ExampleFunction · 0.52
ExampleContextHandlerFunction · 0.52
ExampleRequest_ErrorFunction · 0.52
TestServiceBasicsFunction · 0.52
TestContextHandlerFunction · 0.52
TestRequestRespondFunction · 0.52