{"record":{"id":"61bcd59aa7fc06ff","repo":"jackwener/OpenCLI","slug":"manus-label-failed-http-value-httperror","errorCode":null,"errorMessage":"Manus ${label} failed (HTTP ${value.__httpError}): ${message}","messagePattern":"Manus (.+?) failed \\(HTTP (.+?)\\): (.+?)","errorType":"http","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/manus/_utils.js","lineNumber":68,"sourceCode":"function extractErrorMessage(payload) {\n    if (!payload || typeof payload !== 'object') return '';\n    const candidates = [\n        payload.message,\n        payload.error,\n        payload.errorMessage,\n        payload.details,\n    ];\n    return candidates.find((value) => typeof value === 'string' && value.trim())?.trim() || '';\n}\n\nexport function requireObject(payload, label) {\n    const value = unwrapEvaluateResult(payload);\n    if (value?.__authRequired) {\n        throw new AuthRequiredError(MANUS_DOMAIN, value.message || 'Authentication required — please sign in to Manus in the browser');\n    }\n    if (value?.__httpError) {\n        const message = extractErrorMessage(value);\n        throw new CommandExecutionError(message ? `Manus ${label} failed (HTTP ${value.__httpError}): ${message}` : `Manus ${label} failed (HTTP ${value.__httpError})`);\n    }\n    if (value?.__error) {\n        throw new CommandExecutionError(`Manus ${label} failed: ${value.message || value.__error}`);\n    }\n    if (!value || typeof value !== 'object' || Array.isArray(value)) {\n        throw new CommandExecutionError(`Manus ${label} returned a malformed API payload`);\n    }\n    return value;\n}\n\nexport function requireArray(value, label) {\n    if (!Array.isArray(value)) {\n        throw new CommandExecutionError(`Manus ${label} returned a malformed API payload`);\n    }\n    return value;\n}\n\nexport function requireString(value, label) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/manus/_utils.js#L50-L86","documentation":"CommandExecutionError thrown by requireObject() when the payload has __httpError (a non-2xx HTTP status captured in-page) and an error message could be extracted. It wraps the HTTP status and server-provided message into one actionable string.","triggerScenarios":"In-page fetch to a Manus API endpoint returns 4xx/5xx with a parseable error body; e.g. 403 for forbidden resources, 429 rate limiting, 500 server errors, 404 wrong endpoint after API changes.","commonSituations":"Hitting rate limits from rapid repeated calls, requesting resources the account lacks permission for, Manus API path changes producing 404s, transient 5xx during incidents.","solutions":["Read the embedded HTTP status: retry with backoff on 429/5xx.","On 403/401, re-authenticate in the browser and confirm account access.","On 404, update the CLI — the endpoint path likely changed.","Reduce request frequency if repeatedly rate limited."],"exampleFix":"// client retry pattern\ntry {\n  const sessions = await manusSessions();\n} catch (e) {\n  if (/HTTP 429|HTTP 5\\d\\d/.test(e.message)) await sleep(2000);\n  else throw e;\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":"function isHttpFailure(v) { return v != null && typeof v === 'object' && typeof v.__httpError === 'number'; }","tryCatchPattern":"try {\n  const data = await manusData();\n} catch (e) {\n  const m = /HTTP (\\d{3})/.exec(e.message);\n  if (m && (m[1] === '429' || m[1][0] === '5')) {\n    await new Promise(r => setTimeout(r, 2000));\n    return retry();\n  }\n  throw e;\n}","preventionTips":["Add exponential backoff for 429/5xx statuses.","Rate-limit your scripts to stay under Manus quotas.","Confirm account permissions for the endpoints you call."],"tags":["http","api","network"],"backgroundTag":"http-error-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}