{"record":{"id":"68746ef4325f4de1","repo":"go-delve/delve","slug":"s-d-d-v","errorCode":null,"errorMessage":"%s:%d:%d: %v","messagePattern":"%s:%d:%d: %v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/terminal/starbind/starlark.go","lineNumber":389,"sourceCode":"\nfunc isCancelled(thread *starlark.Thread) error {\n\tif ctx, ok := thread.Local(dlvContextName).(context.Context); ok {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn ctx.Err()\n\t\tdefault:\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc decorateError(thread *starlark.Thread, err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\tpos := thread.CallFrame(1).Pos\n\tif pos.Col > 0 {\n\t\treturn fmt.Errorf(\"%s:%d:%d: %v\", pos.Filename(), pos.Line, pos.Col, err)\n\t}\n\treturn fmt.Errorf(\"%s:%d: %v\", pos.Filename(), pos.Line, err)\n}\n\ntype EchoWriter interface {\n\tio.Writer\n\tEcho(string)\n\tFlush()\n}\n\n// execFileOptions is a wrapper around starlark.ExecFileOptions.\n// If no options are provided, it uses default options.\nfunc execFileOptions(opts *syntax.FileOptions, thread *starlark.Thread, path string, source any, env starlark.StringDict) (starlark.StringDict, error) {\n\tif opts == nil {\n\t\topts = defaultSyntaxFileOpts\n\t}\n\treturn starlark.ExecFileOptions(opts, thread, path, source, env)\n}","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/starbind/starlark.go#L371-L407","documentation":"decorateError wraps errors raised while executing starlark code with the current starlark call frame position, producing `file:line:col: err` when a column is available. This is the column-aware branch of the decorator used by every builtin that reports errors back to scripts.","triggerScenarios":"Any error returned by a starlark builtin (e.g. an RPC wrapper in starlark_mapping.go) while the thread's CallFrame(1) position has a non-zero column — typically errors raised during evaluation of statements at a known position.","commonSituations":"Script authors see `myscript.star:12:5: unknown argument \"Foo\"` and need to know the inner error came from a builtin call on that line/column.","solutions":["Read the reported file:line:col and inspect the builtin call at that position in the script.","Fix the root-cause error named after the colon (e.g. wrong kwarg name).","Enable script debugging/print statements to confirm argument values passed at that position."],"exampleFix":"// before (script)\ndebug.GetBreakpoint(Id=bad_arg)\n// after\ndebug.GetBreakpoint(Id=1)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"# starlark scripts cannot catch decorated errors; in Go host:\nerr := env.Execute(...)\nvar se *starlark.EvalError\nif errors.As(err, &se) { /* se.Backtrace() has position */ }\nfmt.Printf(\"script failed: %v\\n\", err) // shows file:line:col: msg","preventionTips":["Parse the file:line:col prefix programmatically to point users at the failing line","Fix the inner error named after the position prefix"],"tags":["go","starlark","error-decoration","diagnostics"],"backgroundTag":"starlark-position-wrapped-error","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}