{"record":{"id":"ba36ae12045fb127","repo":"Foundry376/Mailspring","slug":"expected-string-but-ran-out-of-input","errorCode":null,"errorMessage":"Expected string but ran out of input","messagePattern":"Expected string but ran out of input","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/services/search/search-query-parser.ts","lineNumber":24,"sourceCode":"  FromQueryExpression,\n  ToQueryExpression,\n  SubjectQueryExpression,\n  GenericQueryExpression,\n  TextQueryExpression,\n  UnreadStatusQueryExpression,\n  StarredStatusQueryExpression,\n  DateQueryExpression,\n  InQueryExpression,\n  HasAttachmentQueryExpression,\n  QueryExpression,\n} from './search-query-ast';\n\nconst nextStringToken = (text: string): [SearchQueryToken, string] => {\n  if (text[0] !== '\"') {\n    throw new Error('Expected string token to begin with double quote (\")');\n  }\n  if (text.length < 2) {\n    throw new Error('Expected string but ran out of input');\n  }\n  let pos = 1;\n  while (pos < text.length) {\n    const c = text[pos];\n    if (c === '\"') {\n      return [new SearchQueryToken(text.substring(1, pos)), text.substring(pos + 1)];\n    }\n    pos += 1;\n  }\n  throw new Error('Expected string but ran out of input');\n};\n\nconst isWhitespace = (c) => {\n  switch (c) {\n    case ' ':\n    case '\\t':\n    case '\\n':\n      return true;","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/services/search/search-query-parser.ts#L6-L42","documentation":"nextStringToken found an opening double quote but the input ended before any content or closing quote — i.e. a quoted string in the search query is truncated ('from: \"foo'). Raised while tokenizing the user's search query.","triggerScenarios":"Thrown at app/src/services/search/search-query-parser.ts:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Close the unclosed double quote in the search query","Remove the trailing quote if the value was not meant to be quoted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}