{"record":{"id":"6fd91de39c78114f","repo":"jackwener/OpenCLI","slug":"upload-error-6fd91d","errorCode":"UPLOAD_ERROR","errorMessage":"UPLOAD_ERROR","messagePattern":"UPLOAD_ERROR","errorType":"error_code","errorClass":"CliError","httpStatus":null,"severity":"error","filePath":"clis/yollomi/upload.js","lineNumber":66,"sourceCode":"        const result = await page.evaluate(`\n      (async () => {\n        try {\n          const raw = atob(${JSON.stringify(b64)});\n          const arr = new Uint8Array(raw.length);\n          for (let i = 0; i < raw.length; i++) arr[i] = raw.charCodeAt(i);\n          const file = new File([arr], ${JSON.stringify(fileName)}, { type: ${JSON.stringify(mime)} });\n          const fd = new FormData();\n          fd.append('file', file);\n          const res = await fetch('/api/upload', { method: 'POST', body: fd, credentials: 'include' });\n          const json = await res.json();\n          return { ok: res.ok, status: res.status, data: json };\n        } catch (err) {\n          return { ok: false, status: 0, data: { error: err.message } };\n        }\n      })()\n    `);\n        if (!result?.ok) {\n            throw new CliError('UPLOAD_ERROR', result?.data?.error || 'Upload failed', 'Make sure you are logged in to yollomi.com');\n        }\n        const url = result.data.url;\n        log.success('Uploaded! Use this URL as input for other commands.');\n        return [{ status: 'uploaded', file: fileName, size: fmtBytes(data.length), url }];\n    },\n});\n","sourceCodeStart":48,"sourceCodeEnd":73,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/yollomi/upload.js#L48-L73","documentation":"UPLOAD_ERROR is thrown when the in-browser upload fetch to yollomi.com does not return { ok: true }. The error message carries the site's own error text from result.data.error, or the generic 'Upload failed'. It indicates the request reached the page context but the remote upload rejected it or the browser-side flow broke.","triggerScenarios":"page.evaluate returns result with ok=false — the browser fetch inside the yollomi.com page threw (caught in-page returning {ok:false,status:0,data:{error:err.message}}) or the server returned an error body; also result being null/undefined.","commonSituations":"Not logged in to yollomi.com in the bridged Chrome session, an expired session cookie, a network failure inside the browser, or the site returning 4xx/5xx for the upload endpoint.","solutions":["Open the bridged Chrome window and confirm you are logged in to yollomi.com, then retry","Re-run the command — the message text (result.data.error) tells you the specific server/browser-side cause","Check network connectivity from the Chrome instance (proxy, VPN, corporate firewall)","Verify the Browser Bridge extension/page is active and not showing an error"],"exampleFix":"// before\nyollomi upload ./photo.jpg\n// UPLOAD_ERROR: Upload failed\n// after\n# open Chrome, log in at https://yollomi.com, then:\nyollomi upload ./photo.jpg","handlingStrategy":"try-catch","validationCode":"// no reliable pre-call validation; at minimum confirm a browser page on yollomi.com is reachable\n// and that you hold a session (logged in) before invoking upload.","typeGuard":"null","tryCatchPattern":"try {\n  await upload(file);\n} catch (e) {\n  if (e.code === 'UPLOAD_ERROR') {\n    console.error(`${e.message} — hint: ${e.hint}`);\n    // surface e.message: it contains the site's own error text\n  } else throw e;\n}","preventionTips":["Verify login state on yollomi.com in the bridged Chrome before batch uploads","Keep the Browser Bridge running and healthy","Retry once on transient failures and log result.data.error for diagnosis"],"tags":["cli","file-upload","network","authentication"],"backgroundTag":"upload-request-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}