{"record":{"id":"76c2a58abb5b492a","repo":"chenhg5/cc-connect","slug":"weibo-parse-ws-endpoint-w","errorCode":null,"errorMessage":"weibo: parse ws endpoint: %w","messagePattern":"weibo: parse ws endpoint: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/weibo/weibo.go","lineNumber":253,"sourceCode":"\t\tcase <-time.After(delay):\n\t\t}\n\n\t\tdelay = min(delay*2, maxReconnect)\n\t}\n}\n\nfunc (p *Platform) connect() error {\n\tp.connMu.Lock()\n\tdefer p.connMu.Unlock()\n\n\ttok, err := p.getToken()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tu, err := url.Parse(p.wsEndpoint)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"weibo: parse ws endpoint: %w\", err)\n\t}\n\tq := u.Query()\n\tq.Set(\"app_id\", p.appID)\n\tq.Set(\"token\", tok)\n\tu.RawQuery = q.Encode()\n\n\tws, _, err := websocket.DefaultDialer.DialContext(p.ctx, u.String(), nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"weibo: ws dial: %w\", err)\n\t}\n\n\tp.wsMu.Lock()\n\tif p.ws != nil {\n\t\tp.ws.Close()\n\t}\n\tp.ws = ws\n\tp.wsMu.Unlock()\n","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/weibo/weibo.go#L235-L271","documentation":"url.Parse rejected the configured Weibo WebSocket endpoint (p.wsEndpoint from config), so the connection URL for the message stream could not be built in connect. This is a static configuration error, not a runtime/network failure.","triggerScenarios":"Thrown at platform/weibo/weibo.go:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the ws_endpoint value in config.toml so it is a valid URL (e.g. wss://...: scheme present, no stray characters)","Validate ws_endpoint at platform construction time so misconfiguration fails fast with a clear message"],"exampleFix":null,"handlingStrategy":"validation","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"}