{"record":{"id":"0921604e30986cfd","repo":"multica-ai/multica","slug":"create-form-file-w","errorCode":null,"errorMessage":"create form file: %w","messagePattern":"create form file: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/internal/cli/client.go","lineNumber":442,"sourceCode":"\tDownloadURL string `json:\"download_url\"`\n\t// MarkdownURL is the durable, persistable URL to embed in markdown bodies\n\t// (chat replies, comments). Unlike DownloadURL it never carries a TTL.\n\tMarkdownURL string `json:\"markdown_url\"`\n\tFilename    string `json:\"filename\"`\n\tContentType string `json:\"content_type\"`\n\tSizeBytes   int64  `json:\"size_bytes\"`\n\tCreatedAt   string `json:\"created_at\"`\n}\n\n// UploadFile uploads a file via multipart form to /api/upload-file.\n// It returns the attachment ID from the server response.\nfunc (c *APIClient) UploadFile(ctx context.Context, fileData []byte, filename string, issueID string) (string, error) {\n\tvar body bytes.Buffer\n\twriter := multipart.NewWriter(&body)\n\n\tpart, err := writer.CreateFormFile(\"file\", filepath.Base(filename))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"create form file: %w\", err)\n\t}\n\tif _, err := part.Write(fileData); err != nil {\n\t\treturn \"\", fmt.Errorf(\"write file data: %w\", err)\n\t}\n\n\tif issueID != \"\" {\n\t\tif err := writer.WriteField(\"issue_id\", issueID); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"write issue_id field: %w\", err)\n\t\t}\n\t}\n\n\tif err := writer.Close(); err != nil {\n\t\treturn \"\", fmt.Errorf(\"close multipart writer: %w\", err)\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodPost, c.BaseURL+\"/api/upload-file\", &body)\n\tif err != nil {\n\t\treturn \"\", err","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/cli/client.go#L424-L460","documentation":"Error \"create form file: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/internal/cli/client.go:442 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the file to upload is readable and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}