{"record":{"id":"aa9f050ebce1bdb2","repo":"go-delve/delve","slug":"s-d-v","errorCode":null,"errorMessage":"%s:%d: %v","messagePattern":"%s:%d: %v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/terminal/starbind/starlark.go","lineNumber":391,"sourceCode":"\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}\n\n// evalOptions is a wrapper around starlark.EvalOptions.","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/starbind/starlark.go#L373-L409","documentation":"The fallback branch of decorateError: when the starlark call frame position has no column information, the error is prefixed as `file:line: err`. It exists so all builtin errors are located, even when position metadata lacks a column.","triggerScenarios":"Builtin errors raised from contexts where thread.CallFrame(1).Pos.Col == 0, e.g. errors produced during execution of code loaded without column info or from predeclared helpers.","commonSituations":"Scripts run via Execute where errors surface with only line numbers; users must inspect the whole line rather than an exact column.","solutions":["Locate the indicated line in the script and check the builtin call there.","Fix the underlying error message after the line number.","If column info is consistently missing and hampers debugging, report it upstream with the script."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := env.Execute(...)\nif err != nil {\n    // message shape: \"<file>:<line>: <cause>\"\n    parts := strings.SplitN(err.Error(), \": \", 3)\n    log.Printf(\"script error at %s line %s: %s\", parts[0], parts[1], parts[2])\n}","preventionTips":["Treat the line number as approximate when no column is present","Inspect the entire statement on the reported line"],"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"}