{"record":{"id":"0b4d64985e9bad3b","repo":"jackwener/OpenCLI","slug":"no-keys-match-flt-0b4d64","errorCode":null,"errorMessage":"No keys match \"${flt}\".","messagePattern":"No keys match \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/trae-solo/renderer-storage.js","lineNumber":59,"sourceCode":"        { name: 'limit', type: 'int', required: false, default: 100, help: 'Max rows to return' },\n    ],\n    columns: ['Index', 'Key', 'Bytes', 'Name', 'Preview', 'Database', 'Version'],\n    func: async (page, kwargs) => {\n        const store = pickStore(kwargs);\n        const raw = await page.evaluate(`(() => {\n      const s = ${store};\n      const out = [];\n      for (let i = 0; i < s.length; i++) {\n        const k = s.key(i);\n        const v = s.getItem(k) || '';\n        out.push({ k, bytes: v.length });\n      }\n      return out;\n    })()`);\n        const flt = kwargs?.filter ? String(kwargs.filter).toLowerCase() : null;\n        const filtered = flt ? raw.filter((r) => r.k.toLowerCase().includes(flt)) : raw;\n        if (!filtered.length) {\n            throw new EmptyResultError('trae-solo storage-keys', flt ? `No keys match \"${flt}\".` : `${store} is empty.`);\n        }\n        filtered.sort((a, b) => a.k.localeCompare(b.k));\n        const limit = Number.isInteger(kwargs?.limit) && kwargs.limit > 0 ? kwargs.limit : 100;\n        return filtered.slice(0, limit).map((r, i) => ({\n            Index: i + 1,\n            Key: r.k,\n            Bytes: r.bytes,\n            Name: '',\n            Preview: '',\n            Database: '',\n            Version: '',\n        }));\n    },\n});\n\n// -------- storage-get --------\ncli({\n    site: 'trae-solo',","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/trae-solo/renderer-storage.js#L41-L77","documentation":"EmptyResultError from the trae-solo `storage-keys` command when, after enumerating all keys in the chosen Web Storage area, the optional lowercase substring `filter` matches zero keys. The library throws it instead of returning an empty table so callers can distinguish 'no match' from success.","triggerScenarios":"Running storage-keys with a `filter` substring that no key in localStorage/sessionStorage contains (case-insensitive), e.g. filtering for 'token' when only 'theme' and 'lang' keys exist.","commonSituations":"Hunting for an auth/token key that the app stores under a different name; filtering in the wrong storage area (local vs session); keys were cleared by logout or a recent app update renamed them; filter substring typo.","solutions":["Drop the `filter` kwarg to list all keys, then search the output manually.","Try a shorter or alternative substring (e.g. 'auth', 'user', the app's prefix).","Switch `storage` to 'session' in case the key lives in sessionStorage.","Confirm the Trae page state — log in / trigger the feature that writes the key before enumerating."],"exampleFix":"// before\nawait cli('trae-solo', 'storage-keys', { filter: 'jwt' });\n// after\nconst keys = await cli('trae-solo', 'storage-keys', {}); // no filter\nconsole.log(keys.map(k => k.Key)); // pick the real name, then filter","handlingStrategy":"fallback","validationCode":"const all = await cli('trae-solo', 'storage-keys', {});\nconst matches = all.filter(k => k.Key.toLowerCase().includes(flt));\nif (!matches.length) console.warn(`No key contains '${flt}'. All keys:`, all.map(k => k.Key));","typeGuard":"const hasKeyMatching = (rows, flt) =>\n  Array.isArray(rows) && rows.some(r => typeof r.Key === 'string' && r.Key.toLowerCase().includes(flt.toLowerCase()));","tryCatchPattern":"try {\n  rows = await cli('trae-solo', 'storage-keys', { filter: flt });\n} catch (e) {\n  if (/No keys match/.test(e.message)) {\n    rows = await cli('trae-solo', 'storage-keys', {}); // unfiltered fallback\n  } else throw e;\n}","preventionTips":["List all keys unfiltered first, then pick the substring from real output.","Try progressively shorter filter substrings.","Check both storage areas (local and session).","Confirm the app state (logged in, feature used) that writes the key."],"tags":["empty-result","storage","filter","trae"],"backgroundTag":"no-matching-keys","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}