We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a06446 commit f351b12Copy full SHA for f351b12
aibridged/anthropic_utils.go
@@ -15,20 +15,22 @@ func getAnthropicErrorResponse(err error) *AnthropicErrorResponse {
15
}
16
17
msg := apierr.Error()
18
+ typ := string(ant_constant.ValueOf[ant_constant.APIError]())
19
20
var detail *anthropic.BetaAPIError
21
if field, ok := apierr.JSON.ExtraFields["error"]; ok {
22
_ = json.Unmarshal([]byte(field.Raw()), &detail)
23
24
if detail != nil {
25
msg = detail.Message
26
+ typ = string(detail.Type)
27
28
29
return &AnthropicErrorResponse{
30
BetaErrorResponse: &anthropic.BetaErrorResponse{
31
Error: anthropic.BetaErrorUnion{
32
Message: msg,
- Type: string(detail.Type),
33
+ Type: typ,
34
},
35
Type: ant_constant.ValueOf[ant_constant.Error](),
36
0 commit comments