JSONErrorValue implements the errorResponseValue interface.
()
| 93 | |
| 94 | // JSONErrorValue implements the errorResponseValue interface. |
| 95 | func (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. |
| 107 | func (e APIError) Is(targetI error) bool { |