{"record":{"id":"9b528f70b924017d","repo":"chenhg5/cc-connect","slug":"matrix-send-w","errorCode":null,"errorMessage":"matrix: send: %w","messagePattern":"matrix: send: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/matrix/matrix.go","lineNumber":398,"sourceCode":"\t}\n\thandler(p, msg)\n}\n\n// sendRoomEvent sends an event to a room, encrypting it if E2EE is available and the room is encrypted.\nfunc (p *Platform) sendRoomEvent(ctx context.Context, roomID id.RoomID, evtType event.Type, content any) error {\n\tclient := p.getClient()\n\tif client == nil {\n\t\treturn fmt.Errorf(\"matrix: not connected\")\n\t}\n\n\t// Try E2EE path first (only available when built with goolm tag)\n\tif handled, err := p.tryEncryptAndSend(ctx, client, roomID, evtType, content); handled {\n\t\treturn err\n\t}\n\n\t_, err := client.SendMessageEvent(ctx, roomID, evtType, content)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"matrix: send: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (p *Platform) Reply(ctx context.Context, rctx any, content string) error {\n\trc, ok := rctx.(replyContext)\n\tif !ok {\n\t\treturn fmt.Errorf(\"matrix: invalid reply context type %T\", rctx)\n\t}\n\n\tparsed := format.RenderMarkdown(content, true, false)\n\tparsed.Body = content\n\tif content != \"\" {\n\t\tparsed.RelatesTo = &event.RelatesTo{}\n\t\tparsed.RelatesTo.SetReplyTo(rc.messageID)\n\t}\n\n\treturn p.sendRoomEvent(ctx, rc.roomID, event.EventMessage, &parsed)","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/matrix/matrix.go#L380-L416","documentation":"Wrapped error from mautrix SendMessageEvent when sending a room event (plaintext path, after the E2EE path declined to handle it); the homeserver rejected or failed the send for replies, images, files, or message updates.","triggerScenarios":"Thrown at platform/matrix/matrix.go:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry; check the bot user's room membership/permissions","If the room is encrypted but built without the goolm tag, sends will keep failing"],"exampleFix":null,"handlingStrategy":"retry","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"}