{"record":{"id":"cd982cab2c5a3011","repo":"projectdiscovery/katana","slug":"could-not-get-vertex","errorCode":null,"errorMessage":"could not get vertex","messagePattern":"could not get vertex","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/engine/headless/graph/graph.go","lineNumber":108,"sourceCode":"func (g *CrawlGraph) GetPageState(id string) (*types.PageState, error) {\n\tpageVertex, err := g.graph.Vertex(id)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not get vertex\")\n\t}\n\treturn &pageVertex, nil\n}","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/engine/headless/graph/graph.go#L90-L126","documentation":"CrawlGraph.GetPageState fails when graph.Vertex(id) cannot find or return the vertex for the given page-state hash — i.e. the requested state was never added to the crawl graph or the ID is wrong. Callers isCorrectNavigation and navigateBackToStateOrigin rely on this lookup to validate or plan navigation.","triggerScenarios":"Thrown at pkg/engine/headless/graph/graph.go:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for graph.ErrVertexNotFound and treat the state as unknown","Confirm the hash ID passed in was produced by the same crawl run (sha256 of stripped DOM)","Ensure AddPageState was called for the state before looking it up","Return a typed not-found error so callers can distinguish missing states from graph failures"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e3e742739c3746f085943ce918fb4e2b8daf6fe6","analyzedAt":"2026-09-03T14:55:13.248Z","contentChangedAt":"2026-09-03T14:55:13.248Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}