gograph_errors
Find and catalog all error and panic sites in Go code, including errors.New, fmt.Errorf, sentinel vars, and panic calls. Filter by substring to check if an error message already exists before adding new ones.
Instructions
Find all error and panic sites in the codebase: errors.New, fmt.Errorf, sentinel var declarations, and panic calls. The MCP server checks freshness before this call and refreshes in the current requested analysis mode; precise and precise_fallback graphs retry CHA/SSA after source changes. Read-only; no side effects. Optional term filters by message substring (e.g., "ErrInvalid", "unauthorized"). WHEN TO USE: When cataloging error codes and panic paths, standardizing error messages, or checking whether a specific error string is already defined before adding a new one. NOT TO USE: For tracing how an error propagates up the call stack (use gograph_errorflow instead). RETURNS: List of error or panic sites with message text, file path, and line number; empty when no matches found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | No | Optional keyword to filter the returned error structures (e.g., 'ErrInvalid', 'unauthorized') | |
| no_tests | No | Exclude error sites in *_test.go files |