UnmarshalJSON implements json.Unmarshaler.
(data []byte)
| 57 | |
| 58 | // UnmarshalJSON implements json.Unmarshaler. |
| 59 | func (e *Error) UnmarshalJSON(data []byte) error { |
| 60 | s := new(spb.Status) |
| 61 | if err := JSONCodec.Unmarshal(data, s); err != nil { |
| 62 | return err |
| 63 | } |
| 64 | errFromStatus := FromGRPCStatus(status.FromProto(s)) |
| 65 | *e = *errFromStatus |
| 66 | return nil |
| 67 | } |
no test coverage detected