{"record":{"id":"34f5ce805974d3ea","repo":"jackwener/OpenCLI","slug":"no-wayback-snapshot-for-target","errorCode":null,"errorMessage":"No Wayback snapshot for \"${target}\".","messagePattern":"No Wayback snapshot for \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/archive/wayback.js","lineNumber":69,"sourceCode":"                    'User-Agent': 'opencli/1.0 (+https://github.com/jackwener/opencli)',\n                },\n            });\n        } catch (error) {\n            throw new CommandExecutionError(`archive wayback request failed: ${error?.message || error}`);\n        }\n        if (!resp.ok) {\n            throw new CommandExecutionError(`archive wayback failed: HTTP ${resp.status}`);\n        }\n        let data;\n        try {\n            data = await resp.json();\n        } catch (error) {\n            throw new CommandExecutionError(`archive wayback returned malformed JSON: ${error?.message || error}`);\n        }\n\n        const snap = data?.archived_snapshots?.closest;\n        if (!snap || !snap.available) {\n            throw new EmptyResultError('archive wayback', `No Wayback snapshot for \"${target}\".`);\n        }\n        if (typeof snap.url !== 'string' || !snap.url || !/^\\d{14}$/.test(String(snap.timestamp ?? ''))) {\n            throw new CommandExecutionError('archive wayback returned malformed payload: closest snapshot is missing url/timestamp');\n        }\n\n        return [{\n            original_url: String(data.url ?? target),\n            requested_timestamp: timestamp,\n            snapshot_timestamp: String(snap.timestamp ?? ''),\n            snapshot_url: String(snap.url),\n            status: String(snap.status ?? ''),\n        }];\n    },\n});\n","sourceCodeStart":51,"sourceCodeEnd":84,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/archive/wayback.js#L51-L84","documentation":"An EmptyResultError thrown when the Wayback save API response contains no archived snapshot (or the closest snapshot is marked unavailable). This is an expected outcome, not a fault: it tells the user that no archived copy of the target exists or was just created. The second argument is a human-facing hint including the requested URL.","triggerScenarios":"`opencli archive wayback <url>` where data.archived_snapshots.closest is missing, null, or has available:false — e.g. the save job has not been processed yet, or the URL has never been archived and the save was queued asynchronously.","commonSituations":"Archiving a brand-new URL and querying too soon before the snapshot registers; typo'd or dead URLs; the save API returning a 200 with an empty snapshots object while the job processes.","solutions":["Wait a few seconds and re-run the command — newly queued saves take time to register","Verify the URL is reachable and correctly spelled","Check the target manually at web.archive.org to confirm archiving is possible","If scripting around it, catch EmptyResultError and implement a delayed retry"],"exampleFix":"// before\nconst out = await exec('opencli archive wayback ' + url);\n// after\ntry {\n  return await exec('opencli archive wayback ' + url);\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    await new Promise(r => setTimeout(r, 10000));\n    return await exec('opencli archive wayback ' + url); // retry once after queue delay\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  const out = await runWayback(url);\n  return out;\n} catch (e) {\n  if (e.name === 'EmptyResultError' && e.message.includes('No Wayback snapshot')) {\n    await sleep(10000); // snapshot may still be processing\n    return runWayback(url);\n  }\n  throw e;\n}","preventionTips":["Treat EmptyResultError as an expected outcome, not a crash","Add a delayed retry for freshly-submitted URLs (save jobs register asynchronously)","Verify the URL is live and archivable before scripting around it","Batch-verify targets against web.archive.org before bulk runs"],"tags":["empty-result","archive","wayback"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}