MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / MarshalJSON

Method MarshalJSON

pkg/errors/json.go:38–43  ·  view source on GitHub ↗

MarshalJSON implements json.Marshaler.

()

Source from the content-addressed store, hash-verified

36
37// MarshalJSON implements json.Marshaler.
38func (e *Error) MarshalJSON() ([]byte, error) {
39 if e == nil {
40 return []byte("null"), nil
41 }
42 return JSONCodec.Marshal(e.GRPCStatus().Proto())
43}
44
45// UnmarshalJSON implements json.Unmarshaler.
46//

Callers

nothing calls this directly

Calls 2

GRPCStatusMethod · 0.95
MarshalMethod · 0.65

Tested by

no test coverage detected