MCPcopy
hub / github.com/larksuite/cli / TestBuildAPIError_TroubleshooterAbsent

Function TestBuildAPIError_TroubleshooterAbsent

internal/errclass/classify_test.go:330–340  ·  view source on GitHub ↗

TestBuildAPIError_TroubleshooterAbsent pins that Troubleshooter stays empty when the upstream response omits it — wire envelope must omit the field.

(t *testing.T)

Source from the content-addressed store, hash-verified

328// TestBuildAPIError_TroubleshooterAbsent pins that Troubleshooter stays empty
329// when the upstream response omits it — wire envelope must omit the field.
330func TestBuildAPIError_TroubleshooterAbsent(t *testing.T) {
331 resp := map[string]any{"code": 1470400, "msg": "bad params"}
332 err := errclass.BuildAPIError(resp, errclass.ClassifyContext{})
333 p, ok := errs.ProblemOf(err)
334 if !ok {
335 t.Fatal("ProblemOf returned !ok")
336 }
337 if p.Troubleshooter != "" {
338 t.Errorf("Troubleshooter = %q, want empty when resp omits it", p.Troubleshooter)
339 }
340}
341
342func TestPermissionErrorEnvelopeShape(t *testing.T) {
343 resp := map[string]any{

Callers

nothing calls this directly

Calls 2

BuildAPIErrorFunction · 0.92
ProblemOfFunction · 0.92

Tested by

no test coverage detected