{"record":{"id":"a5f227628e5ebcd9","repo":"go-delve/delve","slug":"no-breakpoint-with-name-s","errorCode":null,"errorMessage":"no breakpoint with name %s","messagePattern":"no breakpoint with name (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/rpc2/server.go","lineNumber":182,"sourceCode":"\treturn nil\n}\n\ntype GetBreakpointIn struct {\n\tId   int\n\tName string\n}\n\ntype GetBreakpointOut struct {\n\tBreakpoint api.Breakpoint\n}\n\n// GetBreakpoint gets a breakpoint by Name (if Name is not an empty string) or by ID.\nfunc (s *RPCServer) GetBreakpoint(arg GetBreakpointIn, out *GetBreakpointOut) error {\n\tvar bp *api.Breakpoint\n\tif arg.Name != \"\" {\n\t\tbp = s.debugger.FindBreakpointByName(arg.Name)\n\t\tif bp == nil {\n\t\t\treturn fmt.Errorf(\"no breakpoint with name %s\", arg.Name)\n\t\t}\n\t} else {\n\t\tbp = s.debugger.FindBreakpoint(arg.Id)\n\t\tif bp == nil {\n\t\t\treturn fmt.Errorf(\"no breakpoint with id %d\", arg.Id)\n\t\t}\n\t}\n\tout.Breakpoint = *bp\n\treturn nil\n}\n\ntype StacktraceIn struct {\n\tId     int64\n\tDepth  int\n\tFull   bool\n\tDefers bool // read deferred functions (equivalent to passing StacktraceReadDefers in Opts)\n\tOpts   api.StacktraceOptions\n\tCfg    *api.LoadConfig","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/rpc2/server.go#L164-L200","documentation":"RPCServer.GetBreakpoint looks up a breakpoint by Name when arg.Name is non-empty; if debugger.FindBreakpointByName returns nil, the RPC returns this error. It is a normal not-found condition, not a fault in the debugger.","triggerScenarios":"GetBreakpoint RPC called with GetBreakpointIn{Name: \"x\"} where no breakpoint with that user-assigned name exists in the current session.","commonSituations":"Typo in breakpoint name; breakpoint was cleared earlier; connecting a client to a fresh debug session that has no named breakpoints.","solutions":["List existing breakpoints first (ListBreakpoints RPC) and use an exact existing name","Create the named breakpoint with CreateBreakpoint before querying it","If the id is known, call GetBreakpoint with Id instead of Name","Guard the call: treat this error as not-found and fall back to creating the breakpoint"],"exampleFix":"// before\nbp, err := client.GetBreakpoint(&api.GetBreakpointIn{Name: \"main-loop\"})\n// after\nbps, _ := client.ListBreakpoints(false)\nfor _, b := range bps {\n    if b.Name == \"main-loop\" { /* found */ }\n}","handlingStrategy":"try-catch","validationCode":"bps, err := client.ListBreakpoints(false)\nexists := func(name string) bool {\n    for _, b := range bps { if b.Name == name { return true } }\n    return false\n}","typeGuard":null,"tryCatchPattern":"_, err := client.GetBreakpoint(&api.GetBreakpointIn{Name: name})\nif err != nil && strings.Contains(err.Error(), \"no breakpoint with name\") {\n    // create it: client.CreateBreakpoint(...)\n}","preventionTips":["Call ListBreakpoints before GetBreakpoint by name","Use exact, unique breakpoint names","Re-sync named breakpoints after Restart or reattach","Treat not-found as recoverable, not fatal"],"tags":["rpc2","breakpoint","not-found"],"backgroundTag":"breakpoint-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}