@@ -405,7 +405,7 @@ func filterBedrockBetaFlags(headers http.Header, model string) {
405405}
406406
407407// writeUpstreamError marshals and writes a given error.
408- func (i * interceptionBase ) writeUpstreamError (w http.ResponseWriter , antErr * ErrorResponse ) {
408+ func (i * interceptionBase ) writeUpstreamError (w http.ResponseWriter , antErr * messagesResponseError ) {
409409 if antErr == nil {
410410 return
411411 }
@@ -415,7 +415,7 @@ func (i *interceptionBase) writeUpstreamError(w http.ResponseWriter, antErr *Err
415415
416416 out , err := json .Marshal (antErr )
417417 if err != nil {
418- i .logger .Warn (context .Background (), "failed to marshal upstream error" , slog .Error (err ), slog .F ("error_payload" , slog . F ( "%+v" , antErr ) ))
418+ i .logger .Warn (context .Background (), "failed to marshal upstream error" , slog .Error (err ), slog .F ("error_payload" , antErr ))
419419 // Response has to match expected format.
420420 // See https://docs.claude.com/en/api/errors#error-shapes.
421421 _ , _ = w .Write ([]byte (fmt .Sprintf (`{
@@ -487,7 +487,7 @@ func accumulateUsage(dest, src any) {
487487 }
488488}
489489
490- func getErrorResponse (err error ) * ErrorResponse {
490+ func getErrorResponse (err error ) * messagesResponseError {
491491 var apierr * anthropic.Error
492492 if ! errors .As (err , & apierr ) {
493493 return nil
@@ -505,7 +505,7 @@ func getErrorResponse(err error) *ErrorResponse {
505505 typ = string (detail .Type )
506506 }
507507
508- return & ErrorResponse {
508+ return & messagesResponseError {
509509 ErrorResponse : & anthropic.ErrorResponse {
510510 Error : anthropic.ErrorObjectUnion {
511511 Message : msg ,
@@ -517,16 +517,16 @@ func getErrorResponse(err error) *ErrorResponse {
517517 }
518518}
519519
520- var _ error = & ErrorResponse {}
520+ var _ error = & messagesResponseError {}
521521
522- type ErrorResponse struct {
522+ type messagesResponseError struct {
523523 * anthropic.ErrorResponse
524524
525525 StatusCode int `json:"-"`
526526}
527527
528- func newErrorResponse (msg error ) * ErrorResponse {
529- return & ErrorResponse {
528+ func newErrorResponse (msg error ) * messagesResponseError {
529+ return & messagesResponseError {
530530 ErrorResponse : & shared.ErrorResponse {
531531 Error : shared.ErrorObjectUnion {
532532 Message : msg .Error (),
@@ -536,7 +536,7 @@ func newErrorResponse(msg error) *ErrorResponse {
536536 }
537537}
538538
539- func (a * ErrorResponse ) Error () string {
539+ func (a * messagesResponseError ) Error () string {
540540 if a .ErrorResponse == nil {
541541 return ""
542542 }
0 commit comments