google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.3k stars 209 forks source link

starlark: skip last frame of stack backtrace if built-in #319

Closed alandonovan closed 3 years ago

alandonovan commented 3 years ago

Instead, the name of the built-in function is append to the error message ("Error in foo: ...").

Arguably, the convention of requiring EvalError messages to start with the name of the function was a mistake, since it's easy to forget, and easier to move the responsibility to the stack trace printing logic, as we do here.