{"record":{"id":"cd3189186bfe3ea5","repo":"chenhg5/cc-connect","slug":"weibo-initial-token-fetch-w","errorCode":null,"errorMessage":"weibo: initial token fetch: %w","messagePattern":"weibo: initial token fetch: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/weibo/weibo.go","lineNumber":110,"sourceCode":"\treturn &Platform{\n\t\tname:          name,\n\t\tappID:         appID,\n\t\tappSecret:     appSecret,\n\t\ttokenEndpoint: tokenEndpoint,\n\t\twsEndpoint:    wsEndpoint,\n\t\tallowFrom:     allowFrom,\n\t\tseen:          make(map[string]struct{}),\n\t}, nil\n}\n\nfunc (p *Platform) Name() string { return p.name }\n\nfunc (p *Platform) Start(handler core.MessageHandler) error {\n\tp.handler = handler\n\tp.ctx, p.cancel = context.WithCancel(context.Background())\n\n\tif _, err := p.refreshToken(); err != nil {\n\t\treturn fmt.Errorf(\"weibo: initial token fetch: %w\", err)\n\t}\n\tslog.Info(p.tag()+\": authenticated\", \"uid\", p.uid)\n\n\tgo p.connectLoop()\n\treturn nil\n}\n\nfunc (p *Platform) Reply(ctx context.Context, rctx any, content string) error {\n\treturn p.sendMessage(rctx, content)\n}\n\nfunc (p *Platform) Send(ctx context.Context, rctx any, content string) error {\n\treturn p.sendMessage(rctx, content)\n}\n\nfunc (p *Platform) Stop() error {\n\tif p.cancel != nil {\n\t\tp.cancel()","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/weibo/weibo.go#L92-L128","documentation":"Wrap in Start of the first refreshToken call: the platform cannot obtain an initial access token from the configured token_endpoint, so startup aborts. The chained error distinguishes the cause — invalid app_id/app_secret (error_code in response), unreachable endpoint (transport), or a non-200 HTTP status.","triggerScenarios":"Thrown at platform/weibo/weibo.go:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error: credential problems require fixing app_id/app_secret; network problems require fixing connectivity to the token endpoint","Allow overriding token_endpoint via config for regional endpoints or proxies","Retry startup with backoff if the failure was transient"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}