{"record":{"id":"ba85a6b06ff0925c","repo":"chenhg5/cc-connect","slug":"matrix-upload-image-w","errorCode":null,"errorMessage":"matrix: upload image: %w","messagePattern":"matrix: upload image: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/matrix/matrix.go","lineNumber":476,"sourceCode":"\t\treturn fmt.Errorf(\"matrix: not connected\")\n\t}\n\n\tmime := img.MimeType\n\tif mime == \"\" {\n\t\tmime = \"image/png\"\n\t}\n\tname := img.FileName\n\tif name == \"\" {\n\t\tname = \"image\"\n\t}\n\n\turi, err := client.UploadMedia(ctx, mautrix.ReqUploadMedia{\n\t\tContentBytes: img.Data,\n\t\tContentType:  mime,\n\t\tFileName:     name,\n\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"matrix: upload image: %w\", err)\n\t}\n\n\tcontent := &event.MessageEventContent{\n\t\tMsgType: event.MsgImage,\n\t\tBody:    name,\n\t\tInfo: &event.FileInfo{\n\t\t\tMimeType: mime,\n\t\t\tSize:     len(img.Data),\n\t\t},\n\t}\n\tif !uri.ContentURI.IsEmpty() {\n\t\tcontent.URL = uri.ContentURI.CUString()\n\t} else {\n\t\tcontent.File = &event.EncryptedFileInfo{\n\t\t\tURL: uri.ContentURI.CUString(),\n\t\t}\n\t}\n","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/matrix/matrix.go#L458-L494","documentation":"Wrapped error from mautrix client.UploadMedia when uploading image bytes to the Matrix content repository; the homeserver's media upload endpoint rejected or failed the request (size limit, auth, network).","triggerScenarios":"Thrown at platform/matrix/matrix.go:476 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check media repo size limits and homeserver availability","Retry on transient errors"],"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-14T00:17:10.932Z"}