MCPcopy Index your code
hub / github.com/larksuite/cli / TestBuildAPIError_LogIDTopLevel

Function TestBuildAPIError_LogIDTopLevel

internal/errclass/classify_test.go:711–725  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

709}
710
711func TestBuildAPIError_LogIDTopLevel(t *testing.T) {
712 resp := map[string]any{
713 "code": 99991679,
714 "msg": "missing scope",
715 "log_id": "lg-top-456",
716 }
717 err := errclass.BuildAPIError(resp, errclass.ClassifyContext{Identity: "user"})
718 p, ok := errs.ProblemOf(err)
719 if !ok {
720 t.Fatalf("ProblemOf returned !ok, err = %T", err)
721 }
722 if p.LogID != "lg-top-456" {
723 t.Errorf("LogID = %q, want lg-top-456", p.LogID)
724 }
725}
726
727func TestBuildPermissionHint_MissingScopeRoutesToAuthLogin(t *testing.T) {
728 // missing_scope means the user authorized the app but did not grant

Callers

nothing calls this directly

Calls 2

BuildAPIErrorFunction · 0.92
ProblemOfFunction · 0.92

Tested by

no test coverage detected