ToResponse marshals e into an *http.Response shaped for the Anthropic API.
()
| 673 | // ToResponse marshals e into an *http.Response shaped for the |
| 674 | // Anthropic API. |
| 675 | func (e *ResponseError) ToResponse() *http.Response { |
| 676 | body, err := json.Marshal(e) |
| 677 | if err != nil { |
| 678 | body = []byte(`{"type":"error","error":{"type":"error","message":"error marshaling upstream error"}}`) |
| 679 | } |
| 680 | return utils.NewJSONErrorResponse(e.StatusCode, e.RetryAfter, body) |
| 681 | } |
nothing calls this directly
no test coverage detected