{"record":{"id":"e87de4d6d3ca4e2a","repo":"jackwener/OpenCLI","slug":"manus-label-failed-value-message-value","errorCode":null,"errorMessage":"Manus ${label} failed: ${value.message || value.__error}","messagePattern":"Manus (.+?) failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/manus/_utils.js","lineNumber":71,"sourceCode":"        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) {\n    const text = String(value ?? '').trim();\n    if (!text) {\n        throw new CommandExecutionError(`Manus ${label} returned a malformed API payload`);","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/manus/_utils.js#L53-L89","documentation":"CommandExecutionError thrown by requireObject() when the payload carries __error — an in-page/application-level failure that was not an HTTP status error — with the server's message surfaced after 'Manus <label> failed:'.","triggerScenarios":"The injected script catches an exception while calling Manus's API (fetch rejection, JSON parse failure, script-level error) and returns {__error: ...} instead of data.","commonSituations":"Network interruption mid-request from the browser context, CORS or CSP blocking the in-page fetch, Manus front-end bundle changes breaking the injected call, DNS/proxy failures.","solutions":["Read the trailing message for the root cause and retry if transient.","Verify connectivity/proxy settings for the browser the CLI drives.","Re-login in the browser in case the failure is session-related.","Update the CLI if Manus changed its internal API/front-end."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isInPageError(v) { return v != null && typeof v === 'object' && v.__error !== undefined; }","tryCatchPattern":"try {\n  const data = await manusData();\n} catch (e) {\n  if (/Manus .* failed:/.test(e.message) && !/HTTP \\d{3}/.test(e.message)) {\n    console.error('In-page request failed:', e.message, '— check connectivity and re-login');\n  } else throw e;\n}","preventionTips":["Verify network/proxy reachability of manus.com from the automated browser.","Re-login when failures cluster after long sessions.","Keep the CLI current with Manus front-end changes."],"tags":["api","network","runtime"],"backgroundTag":"api-request-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}