#5557·k6

Design a mechanism to define Go errors that properly translate to JS errors

Author: joanlopezCreated Jan 15, 2026Updated Sep 14, 2026
Labelsfeaturetriage

Feature Description

As discussed in https://github.com/grafana/k6/pull/5461#issuecomment-3597954566, currently we have no way to define Go errors that properly translate to JS errors (e.g. TypeError), and the mechanisms that exist nowaday, like runtime.NewTypeError(...) are Go-compliant errors (satisfy error interface).

There's this draft proposal written by @oleiade which might be a very good starting point.

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response