{"record":{"id":"fa24e04a4ce9ef4a","repo":"grpc-ecosystem/grpc-gateway","slug":"unknown-termtype-q","errorCode":null,"errorMessage":"unknown termType %q","messagePattern":"unknown termType %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httprule/parse.go","lineNumber":267,"sourceCode":"\tswitch term {\n\tcase \"/\", \"*\", \"**\", \".\", \"=\", \"{\", \"}\":\n\t\tif t != string(term) && t != \"/\" {\n\t\t\treturn \"\", fmt.Errorf(\"expected %q but got %q\", term, t)\n\t\t}\n\tcase typeEOF:\n\t\tif t != eof {\n\t\t\treturn \"\", fmt.Errorf(\"expected EOF but got %q\", t)\n\t\t}\n\tcase typeIdent:\n\t\tif err := expectIdent(t); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\tcase typeLiteral:\n\t\tif err := expectPChars(t); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown termType %q\", term)\n\t}\n\tp.tokens = p.tokens[1:]\n\tp.accepted = append(p.accepted, t)\n\treturn t, nil\n}\n\n// expectPChars determines if \"t\" consists of only pchars defined in RFC3986.\n//\n// https://www.ietf.org/rfc/rfc3986.txt, P.49\n//\n//\tpchar         = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n//\tunreserved    = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n//\tsub-delims    = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n//\t              / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n//\tpct-encoded   = \"%\" HEXDIG HEXDIG\nfunc expectPChars(t string) error {\n\tconst (\n\t\tinit = iota","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/grpc-ecosystem/grpc-gateway/blob/a58a4436a376a4bcc7d8f10c4d4f919a8438bba9/internal/httprule/parse.go#L249-L285","documentation":"Internal parser error from parser.accept: it was invoked with a termType outside its known set (literal separators, EOF, ident, literal). This indicates a bug in the httprule grammar wiring rather than user input; accept cannot classify the terminal and refuses to proceed.","triggerScenarios":"Thrown at internal/httprule/parse.go:267 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report/fix the parser bug: only the defined termTypes (separators, $, ident, literal) may be passed to accept.","Verify no custom modification introduced a new terminal without a case in accept."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a58a4436a376a4bcc7d8f10c4d4f919a8438bba9","analyzedAt":"2026-09-02T10:28:31.537Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}