(t *testing.T)
| 951 | } |
| 952 | |
| 953 | func TestWithProviderUsesExplicitHint(t *testing.T) { |
| 954 | t.Parallel() |
| 955 | |
| 956 | classified := chaterror.Classify(xerrors.New("openai received status 429 from upstream")) |
| 957 | require.Equal(t, "openai", classified.Provider) |
| 958 | |
| 959 | enriched := classified.WithProvider("azure openai") |
| 960 | require.Equal(t, chaterror.ClassifiedError{ |
| 961 | Message: "Azure OpenAI is rate limiting requests.", |
| 962 | Kind: codersdk.ChatErrorKindRateLimit, |
| 963 | Provider: "azure", |
| 964 | Retryable: true, |
| 965 | StatusCode: 429, |
| 966 | }, enriched) |
| 967 | } |
| 968 | |
| 969 | func TestWithProviderAddsProviderWhenUnknown(t *testing.T) { |
| 970 | t.Parallel() |
nothing calls this directly
no test coverage detected