diff --git a/internal/adapters/transcribe/gateway_test.go b/internal/adapters/transcribe/gateway_test.go index 6a8c221..99186d5 100644 --- a/internal/adapters/transcribe/gateway_test.go +++ b/internal/adapters/transcribe/gateway_test.go @@ -3,6 +3,7 @@ package transcribe_test import ( "bytes" "context" + "fmt" "io" "net/http" "net/http/httptest" @@ -15,6 +16,7 @@ import ( "git.d-ma.be/mathias/tapir/internal/adapters/transcribe" "git.d-ma.be/mathias/tapir/internal/domain" + "git.d-ma.be/mathias/tapir/internal/errkind" ) // The httptest server stands in for the LiteLLM gateway: it is the process @@ -230,3 +232,9 @@ func TestGateway_WithNoSegmentsTheTextFieldIsUsedWithWhitespaceCollapsed(t *test require.NoError(t, err) assert.Equal(t, "Hej allihopa. Vi börjar.", got.Text) } + +func TestStatusError_ExposesItsCodeAsAKindAndNotItsSnippet(t *testing.T) { + err := fmt.Errorf("transcribe: %w", &transcribe.StatusError{Code: 502, Snippet: "echoed: Anders ansvarar"}) + + assert.Equal(t, "http_502", errkind.Of(err)) +}