{"record":{"id":"a783d746b4bfff52","repo":"Kong/insomnia","slug":"expected-single-entity-in-the-data-store-but-f","errorCode":null,"errorMessage":"Expected single ${entity} in the data store, but found none.","messagePattern":"Expected single (.+?) in the data store, but found none\\.","errorType":"exception","errorClass":"InsoError","httpStatus":null,"severity":"error","filePath":"packages/insomnia-inso/src/db/models/util.ts","lineNumber":48,"sourceCode":"\nexport const ensureSingleOrNone = <T>(items: T[], entity: string): T | null | undefined => {\n  if (items.length === 1) {\n    return items[0];\n  }\n\n  if (items.length === 0) {\n    return null;\n  }\n\n  throw new InsoError(`Expected single or no ${entity} in the data store, but found multiple (${items.length}).`);\n};\nexport const ensureSingle = <T>(items: T[], entity: string): T => {\n  if (items.length === 1) {\n    return items[0];\n  }\n\n  if (items.length === 0) {\n    throw new InsoError(`Expected single ${entity} in the data store, but found none.`);\n  }\n\n  throw new InsoError(`Expected single ${entity} in the data store, but found multiple (${items.length}).`);\n};\n","sourceCodeStart":30,"sourceCodeEnd":53,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia-inso/src/db/models/util.ts#L30-L53","documentation":"Error \"Expected single ${entity} in the data store, but found none.\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia-inso/src/db/models/util.ts:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}