{"record":{"id":"67a0a8fa84e6daa1","repo":"Eugeny/tabby","slug":"nothing-selected","errorCode":null,"errorMessage":"Nothing selected","messagePattern":"Nothing selected","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"tabby-core/src/services/vault.service.ts","lineNumber":309,"sourceCode":"                    result: null,\n                },\n                ...files.map(f => ({\n                    name: f.key.description,\n                    icon: 'fas fa-file',\n                    result: f,\n                })),\n            ]).catch(() => null)\n            if (result) {\n                return `${this.prefix}${result.key.id}`\n            }\n        }\n        return this.addNewFile(description)\n    }\n\n    async addNewFile (description: string): Promise<string> {\n        const transfers = await this.platform.startUpload()\n        if (!transfers.length) {\n            throw new Error('Nothing selected')\n        }\n        const transfer = transfers[0]\n        const id = (await wrapPromise(this.zone, promisify(crypto.randomBytes)(32))).toString('hex')\n        await this.vault.addSecret({\n            type: VAULT_SECRET_TYPE_FILE,\n            key: {\n                id,\n                description: `${description} (${transfer.getName()})`,\n            },\n            value: Buffer.from(await transfer.readAll()).toString('base64'),\n        })\n        return `${this.prefix}${id}`\n    }\n\n    async retrieveFile (key: string): Promise<Buffer> {\n        if (!key.startsWith(this.prefix)) {\n            throw new Error('Incorrect type')\n        }","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/Eugeny/tabby/blob/14e2d60b9b6dee84a53c37f05eefeb803787de04/tabby-core/src/services/vault.service.ts#L291-L327","documentation":"Thrown by VaultFileProvider.addNewFile when `platform.startUpload()` returns an empty transfers array - i.e. the user dismissed the file picker or selected nothing. There is no file content to store, so the operation cannot proceed.","triggerScenarios":"After the user picks 'Add a new file' (or no existing files exist to choose from), `startUpload()` opens a native picker; if the user cancels it or selects zero files, `transfers.length === 0` and this throws.","commonSituations":"User cancels the OS file-open dialog while importing a private key or other secret; the picker failed to launch (permissions/manifest issue) and returned empty; a non-Electron platform where `startUpload` is a stub returning [].","solutions":["Treat this as a user cancel: catch the error in the calling flow and abort the import silently (no error toast).","Confirm the host platform implements `startUpload` (Electron does via dialog; web/headless may not).","If the picker should not be cancellable, disable the cancel button in the dialog options passed to `startUpload`.","Differentiate 'Nothing selected' from real failures by inspecting the error message in the caller."],"exampleFix":"// before\nconst transfers = await this.platform.startUpload()\nif (!transfers.length) throw new Error('Nothing selected')\n\n// after - distinguish user cancel from platform failure and surface accordingly\nconst transfers = await this.platform.startUpload()\nif (!transfers.length) {\n    throw new Error('Nothing selected')  // caller maps this to a silent abort\n}\n// caller:\ntry { await provider.selectAndStoreFile('Private key') }\ncatch (e) { if (!/Nothing selected/.test(e.message)) throw e }","handlingStrategy":"try-catch","validationCode":"async function pickFileOrAbort (platform: PlatformService): Promise<Transfer[]> {\n    const transfers = await platform.startUpload()\n    if (!transfers.length) throw new Error('Nothing selected')\n    return transfers\n}","typeGuard":null,"tryCatchPattern":"try {\n    return await provider.selectAndStoreFile('Private key')\n} catch (e) {\n    if (e instanceof Error && e.message === 'Nothing selected') return null  // user cancel\n    throw e\n}","preventionTips":["Treat 'Nothing selected' as a benign cancel; never auto-retry.","Confirm the host implements startUpload before relying on it (Electron does; others may not).","Pre-validate that a picker is appropriate (i.e. there is something to pick) before launching.","Differentiate cancel from real platform errors by message matching."],"tags":["vault","file-providers","user-cancel","upload","platform"],"backgroundTag":null,"analyzedSha":"14e2d60b9b6dee84a53c37f05eefeb803787de04","analyzedAt":"2026-08-12T11:46:48.773Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}