{"record":{"id":"6ebd4ae0b98cd22a","repo":"jackwener/OpenCLI","slug":"no-fids-provided-6ebd4a","errorCode":null,"errorMessage":"No fids provided","messagePattern":"No fids provided","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/quark/rm.js","lineNumber":19,"sourceCode":"import { ArgumentError } from '@jackwener/opencli/errors';\nimport { cli, Strategy } from '@jackwener/opencli/registry';\nimport { DRIVE_API, apiPost } from './utils.js';\ncli({\n    site: 'quark',\n    name: 'rm',\n    access: 'write',\n    description: 'Delete files from your Quark Drive',\n    domain: 'pan.quark.cn',\n    strategy: Strategy.COOKIE,\n    defaultFormat: 'json',\n    args: [\n        { name: 'fids', required: true, positional: true, help: 'File IDs to delete (comma-separated)' },\n    ],\n    func: async (page, kwargs) => {\n        const fids = kwargs.fids;\n        const fidList = [...new Set(fids.split(',').map(id => id.trim()).filter(Boolean))];\n        if (fidList.length === 0)\n            throw new ArgumentError('No fids provided');\n        await apiPost(page, `${DRIVE_API}/delete?pr=ucpro&fr=pc`, {\n            filelist: fidList,\n        });\n        return { status: 'ok', count: fidList.length, deleted_fids: fidList };\n    },\n});\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/quark/rm.js#L1-L26","documentation":"Thrown by clis/quark/rm.js when the required positional fids argument is present but yields an empty list after splitting on commas, trimming, and removing blanks/duplicates. The delete API call is skipped to avoid an empty filelist request. It is an ArgumentError.","triggerScenarios":"Running rm with a value like \",,,\" or \"  ,  \"; passing an empty string for the positional argument; a script feeding a variable that only contains separators after trimming.","commonSituations":"Generated fid lists that end up empty because an upstream step (search/list) returned nothing; shell variable holding only commas; misparsed output pasted as the fid argument.","solutions":["Supply at least one real fid: quark rm <fid> or quark rm fid1,fid2.","Get valid fids first via a listing/search command, then pass them to rm.","In scripts, verify the fid list is non-empty before calling rm."],"exampleFix":"// before\nquark rm \"$FIDS\"\n// after\nFIDS=$(echo \"$FIDS\" | tr -d '[:space:]')\n[ -n \"$FIDS\" ] || { echo 'no fids to delete'; exit 1; }\nquark rm \"$FIDS\"","handlingStrategy":"validation","validationCode":"const fidList = String(rawFids || '')\n  .split(',').map(s => s.trim()).filter(Boolean);\nif (fidList.length === 0) throw new Error('rm requires at least one fid');","typeGuard":"function hasFids(v) {\n  return typeof v === 'string' &&\n    v.split(',').map(s => s.trim()).filter(Boolean).length > 0;\n}","tryCatchPattern":null,"preventionTips":["Source fids from a fresh listing command, not stale caches.","Check the fid variable is non-empty before invoking rm.","Strip stray commas/whitespace from generated fid lists."],"tags":["validation","argument-error","quark"],"backgroundTag":"missing-required-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}