{"record":{"id":"14535613fba56f0c","repo":"chenhg5/cc-connect","slug":"invalid-platform-type-q-want-feishu-or-lark","errorCode":null,"errorMessage":"invalid --platform-type %q, want feishu or lark","messagePattern":"invalid --platform-type %q, want feishu or lark","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":459,"sourceCode":"\t}\n\tswitch len(projects) {\n\tcase 0:\n\t\treturn \"\", fmt.Errorf(\"no project found in config\")\n\tcase 1:\n\t\treturn projects[0], nil\n\tdefault:\n\t\tsort.Strings(projects)\n\t\treturn \"\", fmt.Errorf(\"multiple projects found, please specify --project (%s)\", strings.Join(projects, \", \"))\n\t}\n}\n\nfunc normalizeFeishuPlatformType(raw string) (string, error) {\n\traw = strings.ToLower(strings.TrimSpace(raw))\n\tif raw == \"\" {\n\t\treturn \"\", nil\n\t}\n\tif raw != \"feishu\" && raw != \"lark\" {\n\t\treturn \"\", fmt.Errorf(\"invalid --platform-type %q, want feishu or lark\", raw)\n\t}\n\treturn raw, nil\n}\n\nfunc validateAppCredentials(appID, appSecret, platformType string) (string, error) {\n\tappID = strings.TrimSpace(appID)\n\tappSecret = strings.TrimSpace(appSecret)\n\tif appID == \"\" || appSecret == \"\" {\n\t\treturn \"\", errors.New(\"app_id/app_secret are required\")\n\t}\n\n\tcandidates := []string{\"feishu\", \"lark\"}\n\tif platformType == \"feishu\" || platformType == \"lark\" {\n\t\tcandidates = []string{platformType}\n\t}\n\n\tvar lastErr error\n\tfor _, candidate := range candidates {","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L441-L477","documentation":"normalizeFeishuPlatformType validates the --platform-type flag for feishu setup. An empty value is allowed (defaults later), but any value other than \"feishu\" or \"lark\" (case-insensitive, trimmed) throws this error naming the offending input.","triggerScenarios":"Running `cc-connect feishu setup --platform-type something` where something is not feishu/lark, e.g. \"Feishu CN\", \"larksuite\", \"feishu-lark\", or a typo like \"feish\".","commonSituations":"Users copying flags from other platform setups; assuming \"larksuite\" or a region suffix is valid; trailing punctuation from copy-paste is trimmed but a stray word is not.","solutions":["Use --platform-type feishu or --platform-type lark (case-insensitive).","Omit the flag entirely to accept the default.","Fix typos; check the value printed in %q in the error against the two accepted strings."],"exampleFix":"// before\ncc-connect feishu setup --platform-type larksuite\n// after\ncc-connect feishu setup --platform-type lark","handlingStrategy":"validation","validationCode":"pt := strings.ToLower(strings.TrimSpace(platformType)); if pt != \"\" && pt != \"feishu\" && pt != \"lark\" { return fmt.Errorf(\"invalid --platform-type %q\", pt) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use feishu or lark for --platform-type; the check is case-insensitive.","Omit the flag when unsure — empty defaults are applied downstream.","Avoid copying platform-type values from other platform setups."],"tags":["cli","validation","feishu","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}