MCPcopy Create free account
hub / github.com/coder/coder / ToResponse

Method ToResponse

aibridge/intercept/messages/base.go:675–681  ·  view source on GitHub ↗

ToResponse marshals e into an *http.Response shaped for the Anthropic API.

()

Source from the content-addressed store, hash-verified

673// ToResponse marshals e into an *http.Response shaped for the
674// Anthropic API.
675func (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}

Callers

nothing calls this directly

Calls 2

NewJSONErrorResponseFunction · 0.92
MarshalMethod · 0.45

Tested by

no test coverage detected