go-delve/delve · info

%s:%d:%d: %v

Error message

%s:%d:%d: %v

What it means

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.

Source

Thrown at pkg/terminal/starbind/starlark.go:389

func isCancelled(thread *starlark.Thread) error {
	if ctx, ok := thread.Local(dlvContextName).(context.Context); ok {
		select {
		case <-ctx.Done():
			return ctx.Err()
		default:
		}
	}
	return nil
}

func decorateError(thread *starlark.Thread, err error) error {
	if err == nil {
		return nil
	}
	pos := thread.CallFrame(1).Pos
	if pos.Col > 0 {
		return fmt.Errorf("%s:%d:%d: %v", pos.Filename(), pos.Line, pos.Col, err)
	}
	return fmt.Errorf("%s:%d: %v", pos.Filename(), pos.Line, err)
}

type EchoWriter interface {
	io.Writer
	Echo(string)
	Flush()
}

// execFileOptions is a wrapper around starlark.ExecFileOptions.
// If no options are provided, it uses default options.
func execFileOptions(opts *syntax.FileOptions, thread *starlark.Thread, path string, source any, env starlark.StringDict) (starlark.StringDict, error) {
	if opts == nil {
		opts = defaultSyntaxFileOpts
	}
	return starlark.ExecFileOptions(opts, thread, path, source, env)
}

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Read the reported file:line:col and inspect the builtin call at that position in the script.
  2. Fix the root-cause error named after the colon (e.g. wrong kwarg name).
  3. Enable script debugging/print statements to confirm argument values passed at that position.

Example fix

// before (script)
debug.GetBreakpoint(Id=bad_arg)
// after
debug.GetBreakpoint(Id=1)
Defensive patterns

Strategy: try-catch

Try / catch

# starlark scripts cannot catch decorated errors; in Go host:
err := env.Execute(...)
var se *starlark.EvalError
if errors.As(err, &se) { /* se.Backtrace() has position */ }
fmt.Printf("script failed: %v\n", err) // shows file:line:col: msg

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/68746ef4325f4de1. Report an issue: GitHub.