MCPcopy
hub / github.com/dapr/dapr / JSONErrorValue

Method JSONErrorValue

pkg/messages/api_error.go:95–104  ·  view source on GitHub ↗

JSONErrorValue implements the errorResponseValue interface.

()

Source from the content-addressed store, hash-verified

93
94// JSONErrorValue implements the errorResponseValue interface.
95func (e APIError) JSONErrorValue() []byte {
96 b, _ := json.Marshal(struct {
97 ErrorCode string `json:"errorCode"`
98 Message string `json:"message"`
99 }{
100 ErrorCode: e.Tag(),
101 Message: e.Message(),
102 })
103 return b
104}
105
106// Is implements the interface that checks if the error matches the given one.
107func (e APIError) Is(targetI error) bool {

Callers

nothing calls this directly

Calls 3

TagMethod · 0.95
MessageMethod · 0.95
MarshalMethod · 0.45

Tested by

no test coverage detected